[Javascript] firing submit event

Todd Andrew Love todd at imedia-inc.com
Tue Jul 10 11:03:53 CDT 2001


Nevermind. I always have trouble with the case senstivity:

setTimeout (I was using setTimeOut)

Works now.

Thanks!
Todd



----- Original Message -----
From: "Todd Andrew Love" <todd at imedia-inc.com>
To: <javascript at LaTech.edu>
Sent: Tuesday, July 10, 2001 11:54 AM
Subject: Re: [Javascript] firing submit event


> Ben, thanks again for the code, one problem that maybe you can help with.
I
> got the =length code working fine, but I'd like to get the TimeOut code
> working, problem is I keep getting:
>
> Object Expected
>
> Here's my line of code:
> onkeyup="setTimeOut('if (\''+this.value+'\' ==
> document.basform.employee.value) document.basform.submit();',250);"
>
> The form name is basform
> The element name is employee
>
> I tried breaking it down to the simplest of TimeOut code and get the same
> error.
>
> I'm using IE 5.5 on Win2k as my test platform.
>
> Any ideas?
>
> Thanks!
> 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
> >
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list