Hi all.
We are doing form validation using the onBlur event to make sure each textbox is filled before moving on to the next one. However this produces an endless loop in Netscape and you have to close the browser to escape (not very user friendly
).
I have searched the archives here and several people recommended the onBlur event for validation. Has anyone found a way around the Netscape problem or do you all code for IE only?
Here is my code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function verify(field) {
var str = field.name;
if(field.value == "") {
alert("The field is " + str);
field.focus();
}
}
//-->
</SCRIPT>
....
<FORM>
SSN:<input type="text" name="ssn" onBlur="verify(this)" maxlength="9">
First Name: <input type="text" name="firstName" onBlur="verify(this)">
Last Name:<input type="text" name="lastName" onBlur="verify(this)">
</FORM>