Barcode reader + WWW

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotr Nowak

    #1

    Barcode reader + WWW

    Hi
    i need a script that will auto-submit a form when someone enters 11
    characters into one of textfields..

    any ideas?
    Thanks ;-)

    Peter


  • McKirahan

    #2
    Re: Barcode reader + WWW

    "Piotr Nowak" <piotrus@withou tthispocztal.co m> wrote in message
    news:jTWLb.7813 $oM.4722@newssv r16.news.prodig y.com...[color=blue]
    > Hi
    > i need a script that will auto-submit a form when someone enters 11
    > characters into one of textfields..
    >
    > any ideas?
    > Thanks ;-)
    >
    > Peter[/color]

    Perhaps:

    <html>
    <head>
    <title>keypress .htm</title>
    <script type="text/javascript">
    function eleven(that) {
    if (that.value.len gth == 11) {
    document.form1. submit();
    }
    }
    </script>
    </head>
    <body>
    <form action="keypres s.htm" method="get" name="form1">
    <input type="text" onkeypress="ele ven(this)">
    </form>
    </body>
    </html>


    Comment

    • Piotr Nowak

      #3
      Re: Barcode reader + WWW

      thanks... that's what i needed ;-)

      Pete


      Comment

      • HikksNotAtHome

        #4
        Re: Barcode reader + WWW

        In article <jTWLb.7813$oM. 4722@newssvr16. news.prodigy.co m>, "Piotr Nowak"
        <piotrus@withou tthispocztal.co m> writes:
        [color=blue]
        >Hi
        >i need a script that will auto-submit a form when someone enters 11
        >characters into one of textfields..
        >
        >any ideas?[/color]

        And if the 11th character is a tyop? (Yes, thats an intentional typo).
        --
        Randy

        Comment

        • Piotr Nowak

          #5
          Re: Barcode reader + WWW

          > Perhaps:

          nope... it does not work the way it should...
          if i set it to 10 characters, person has to enter 10 chars, the form is
          being submitted, but only 9 characters are submitted. It cuts the last
          character.

          any ideas?


          Comment

          • Piotr Nowak

            #6
            Re: Barcode reader + WWW

            > And if the 11th character is a tyop? (Yes, thats an intentional typo).

            it will be string fed by a barcode reader

            Pete


            Comment

            • HikksNotAtHome

              #7
              Re: Barcode reader + WWW

              In article <l7_Lb.15949$Rc 4.64217@attbi_s 54>, "Piotr Nowak"
              <piotrus@poczta l.com> writes:
              [color=blue][color=green]
              >> Perhaps:[/color]
              >
              >nope... it does not work the way it should...
              >if i set it to 10 characters, person has to enter 10 chars, the form is
              >being submitted, but only 9 characters are submitted. It cuts the last
              >character.
              >
              >any ideas?[/color]

              us the onkeyup or onchange of the field instead of the onkeypress. onkeypress
              fires as soon as the key is pressed, not after its released. And it may be a
              timing issue where the key is pressed, and before its released the form is
              submitted.

              Personally, I would use the onchange event and when the field gets changed, and
              exited, the form would submit.
              --
              Randy

              Comment

              • Piotr Nowak

                #8
                Re: Barcode reader + WWW

                > Personally, I would use the onchange event and when the field gets
                changed, and[color=blue]
                > exited, the form would submit.[/color]

                on change does not work at all
                onkeypress, onkeydown, onkeyup - those are cutting the last character.

                any other ideas? :)



                Comment

                • Piotr Nowak

                  #9
                  Re: Barcode reader + WWW


                  "actually when i set
                  if (that.value.len gth == 3) {

                  it submits 3 characters, but i have to enter 4 to submit that form., nothing
                  happens after entering 3rd char.
                  after 4th form is submitted but i have only 3 chars submitted..



                  Comment

                  • Thomas 'PointedEars' Lahn

                    #10
                    Re: Barcode reader + WWW

                    Piotr Nowak wrote:
                    [color=blue][color=green]
                    >> And if the 11th character is a tyop? (Yes, thats an intentional typo).[/color]
                    >
                    > it will be string fed by a barcode reader[/color]

                    Sorry, if you suggest that the read data should be submitted
                    immediately without user control, you have no clue of how
                    barcode readers (can) (mal)function. Let it be a bug (real
                    or electronical) on the barcode and your whole data is garbled.

                    I strongly recommend against such an automatism.


                    PointedEars

                    Comment

                    Working...