Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto submit form after value

    Hello,
    Is it possible to auto submit a form when a value is filled in an input field. I need this for a barcode scanner. So let's say:

    I scan a barcode with a 6 digitnumber to an inputfield. When there are 6 characters in the inputfield I want to submit the form.

    Is that possible?

    Thanks for any help!

    Samall

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    you can use the onchange event on a form field and submit the form with document.formName.submit()

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    Thanks for your answer. Your script is working, but not exactly what I was searching. The onChange event requires a change. So I have to click on some spot and then the action begins. I need something that automaticly after x charathers the form submit without clicking or using the tab key.

    Is that possible with Javascript?

    Thanks!

    This is the onChange script:
    <form name="testForm" action="test2.htm">
    <input type="text" name="test" onChange="document.testForm.submit()">
    </form>


  •  

    Posting Permissions

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