Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic submission of forms

Status
Not open for further replies.

Elcin

Programmer
Nov 26, 2001
9
SA
Hello,
In my code, I get the input value for a text box from a scanner. Scanner's output is some 6 numbers. Right now, the user needs to press enter key to submit the form so that the related processing can take place. I want to eliminate the user's need to press enter key. So, as soon as the 6th number is read from the scanner, the form should be submitted to the next page for processing.

I am thinking og adding vbcrlf right after it reads the 6th digit but how can I understand the last digit is read? Or I will appreciate it if you have another idea.

Thanks.
 
Maybe you can try onFocus event or check the textbox value every 5 second. ------------------
Freedom is a Right
 
If you loop till you have 6 characters then submit should work...

Have Fun...

Sharky99 >:):O>
 
Sharky99,
I also want to know when the 6th number is read. How can I count the numbers as they are being read? Can you give me the code for it?

Thanks,
 
<script language=javascript>
function checkLength(){
var str = document.theForm.txtInput.value;
if (str.length == 6)
document.theForm.submit();
}
</script>

<form name=theForm method=post action=somePage.asp>
<input type=text name=txtInput onKeyUp=&quot;checkLength();>
</form>

I tested this here on my box, but I have no scanner to test the input method. It definitely works when you type the numbers in, but I'm not positive that the script will see the scanner's input as an event resembling a keyUp.

Worth a shot, though.

:)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top