Jump to content

Form submit on max characters???


FlikstRR

Recommended Posts


Not sure if this is something directly ajax or just javascript in general but im very new to ajax and would really appreciate some pointers/solution to this one if at all possible. Being that i wish to submit a form without page load im going to guess at ajax  :P

i have a barcode scanner'esk' input that submits to a text input. the code is always 12 characters long. They also have the option to type the code (again 12 characters). Once the code reaches 12 characters i want the form to submit so it can be saved to the sql given an id etc etc (i can do all that) and then be ready for the next one..

the aim being so a user has no keyboard entry.. just scans product... it submits so they wait a second or two... scan next one and so on.

can this be done?

I think it may have something to do with 'taskInput.onkeyup'

thank you. Phil
Link to comment
Share on other sites

Submitting alone can be done strictly with JS.  No AJAX needed.  Keep in mind however, that if they are keying this in, you probably don't want to auto-submit in case they screw up the code.

And if you're not using a keyboard, there isn't really a way to do this unless you're using an ActiveX control because there is no way to take input from the PC and stuff it into a website.  And even then, if you're not using a keyboard, there is no way to trigger an event to check the length of the string.

EDIT:... I guess you could use onChange... but I'm not sure that would work correctly or not.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.