[Javascript] firing submit event

Todd Andrew Love todd at imedia-inc.com
Mon Jul 9 17:28:22 CDT 2001


Thanks Ben, I think this will do. Brilliant!

Thanks again,
Todd

----- Original Message -----
From: "Ben Curtis" <Quixote at LaMancha.org>
To: <javascript at latech.edu>
Sent: Thursday, August 09, 2001 6:28 PM
Subject: Re: [Javascript] firing submit event


>
> > I've tried firing it on the "onkeyup" event, but it submits the form
> > multiple times (one for each character in the bar code). It looks like
it is
> > working, but it's actually submitting multiple times.
>
> I think you're on the right track.
>
> Make a delay that is triggered onkeyup, and it fires the submit if the
value
> in the field is the same as when triggered.
>
> onkeyup="setTimeOut('if (\''+this.value+'\' ==
> document.formname.elementname.value) document.formname.submit();', 500);"
>
> This will be triggered for every "keystroke" but will only submit if no
> additional keystrokes happen for half a second (500 milliseconds). You may
> need to adjust this delay, based on your bar readers.
>
> If the barcode is always the same number of digits, say 23, then you can
do
> this instead:
>
> onkeyup="if (this.value.length == 23) document.formname.submit();"
>
> --
> +Ben Curtis
>
> "Most people use statistics the way a drunkard uses a lamp post,
> more for support than illumination."
>
>
>
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list