Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, i'm developing a "time attendance" system whereby a worker scans his ID card and the barcode reader would "enter" his ID into a text box, says 5 digits. i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Feb 2005
    Posts
    290

    [javascript] auto submit upon full input of textbox


    Hi,

    i'm developing a "time attendance" system whereby a worker scans his ID card and the barcode reader would "enter" his ID into a text box, says 5 digits. i have an <input type=text maxlength=5>, is it possible to auto triggle something once the input reaches 5 digits?

    thanks

    regards,
    adam

  2. #2
    Linux User
    Join Date
    Feb 2005
    Posts
    290
    i found it, sorry for troubling

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    1

    I need it

    Kindly I need this exact script that you have discovered for the same reason Time Attendance

  4. #4
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    maybe you could try using some onKeyDown, or onKeyPress and maybe use document.getElementById("id of text fiels").value.lenthof() to query the length.
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  5. #5
    Linux User
    Join Date
    Feb 2005
    Posts
    290
    no problem

    i actually grabbed the code from usenet and did some modification (some of the original elements are still intact :P )

    Code:
    <html> 
      <head> 
      <title>HOW TO&#58; Beep when text field full Using Javascript</title> 
      <meta name="author" content="Shannon Norrell"> 
      <script language="javascript"> 
        function DoCheckLength&#40;aTextBox&#41; &#123; 
          if &#40;aTextBox.maxLength - aTextBox.value.length==0&#41; &#123; 
            document.theForm.submit&#40;&#41;; 
            //beep.play&#40;&#41;; 
          &#125; 
        &#125; 
      </script> 
    </head> 
    <body> 
      <FORM NAME="theForm" action=index.php> 
        <input type="text" maxlength="10" size="10" 
    onkeyup="DoCheckLength&#40;this&#41;;" ID="firstTextBox" name="firstTextBox"> 
        <input type="text" maxlength="5" size="5" 
    onkeyup="DoCheckLength&#40;this&#41;;" ID="secondTextBox" NAME="secondTextBox"> 
      </FORM> 
      <EMBED id="beep" SRC="beep.wav" NAME="beep" AUTOSTART="FALSE" 
    MASTERSOUND HIDDEN="true"> 
    </body> 
    </html>
    good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •