This, combined with changing the onChange to onChange="return barcodeRange(this)", solved the problem.
 
Thank you very much for this assistance.
 
Karen


>>> [EMAIL PROTECTED] 10/16/01 9:27:49 PM >>>
I believe if you change 'window.document.searchreq.barcode.focus();' to 'barcode.focus();', it should work.  Your passing barcode to your function as a reference, so there for barcode is already = to 'document.searchreq.barcode'.

Marlon Moyer


Karen Harker wrote:
[EMAIL PROTECTED]" type="cite">
Yes! Thank you. That solved problem 1 (the most nagging one).
 
Would you by chance happen to know how to fix problem 2?
 
2) When activating the onChange event handler, it brings up the error message, but does not return the focus to the field, but rather to the next field.
 
Thank you, again.
 
Karen


>>> [EMAIL PROTECTED] 10/16/01 5:51:35 PM >>>
Karen try the following:

<!---This checks the barcode number against the possible ranges--->
function barcodeRange(barcode) {
if (!((barcode.value >= '21386000000000' && barcode.value <=
'21386000999999')
|| (barcode.value >= '22222000000000' && barcode.value <=
'22222009999999'))) {
alert("Enter your full UT Southwestern Library card number with no spaces")
window.document.searchreq.barcode.focus();
return(false); <----------- add this line here.
}
}

Marlon


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org


------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com

Reply via email to