I have a text field named "zip" in a form. If the user neglects to enter a zipcode before clicking the button that calls this function, the alert box appears. Upon dismissing the alert box I want the focus to be on the 'zip' text field. I want the user to see that blinking cursor. Why won't this function work? Does it have to do with trying to set focus to a blank field? I'm using IE6 & NS7.
function checkzip() {
if (document.form1.zip.value == ""
{
alert("You forgot to enter your zipcode"
;
document.form1.zip.focus();
return false;
} else {
document.form1.submit();
}
}
Thanks, Gary
function checkzip() {
if (document.form1.zip.value == ""
alert("You forgot to enter your zipcode"
document.form1.zip.focus();
return false;
} else {
document.form1.submit();
}
}
Thanks, Gary