Forum Moderators: open
{
var re5digit=/^\d{5}$/
if (document.feedbackform.zip.value.search(re5digit)==-1)
alert("Please enter a valid 5 digit zip code");
document.feedbackform.zip.focus();
return false;
}
}
if (document.feedbackform.country.value == 'select_your_country') {
alert("Please provide us with a selection.\n");
document.feedbackform.country.focus()
return false;
}
that didn't work. it seems it has to do something with this one;
{
var re5digit=/^\d{5}$/
if (document.feedbackform.zip.value.search(re5digit)==-1)
alert("Please enter a valid 5 digit zip code");
document.feedbackform.zip.focus();
return false;
}
if I take the "return false" it works, but if the entry is "true" i can't get to the next field
{
var re5digit=/^\d{5}$/
if (document.feedbackform.zip.value.search(re5digit)==-1) {
alert("Please enter a valid 5 digit zip code");
document.feedbackform.zip.focus();
return false
}
else return true
}
Kaled.
Opening bracket needs to come after:
if (document.feedbackform.zip.value.search(re5digit)==-1)