Hello. I am trying to find/write a script that will submit a form automatically after a certain number of characters (10) have been entered into a text field. I don't want to have to involve a button or anything like that--as soon as the characters are entered, the form needs to submit. I assume that I'll have to use Javascript or something along those lines, possibly with something like
You would probably add a onkeypress, onkeydown, or onkeyup event to the text/textarea input that calls a Javascript function. That function would check the length of the input's value and submit the form if it was over a certain length.
Sounds incredibly annoying to me. I hope you're not making customers use this broken design Oops, I made a typo, lemme backsp... sh**, where did the form go? Hmm, I'll go to another site instead.
I will be using it to query a database and obtain data based on a number that will be entered using a barcode scanner. The scanner acts like a keyboard, entering the numbers into whatever form is selected. However, I don't want to have to press the enter key every time a number is scanned, so I want it to initiate the query whenever a 10 digit number (ISBN, in this case) is entered into the form.