I know how to validate each field for vaild input but how would I do this for something like a search page where I wanted at least one field filled in and an error to pop up if at least one field was not entered? The user can search on one field or multiple fields, just as long as at least one field was entered.
if (document.formName.fname.value == ''){
alert('First Name can't be blank!');
return false;
}
if (document.formName.lname.value == ''){
alert('Last Name can't be blank!');
return false;
}
if (document.formName.address.value == ''){
alert('Address can't be blank!');
return false;
}
if (document.formName.city.value == ''){
alert('City can't be blank!');
return false;
}
if (document.formName.state.value == ''){
alert('State can't be blank!');
return false;
}
return true;
Thanks.
if (document.formName.fname.value == ''){
alert('First Name can't be blank!');
return false;
}
if (document.formName.lname.value == ''){
alert('Last Name can't be blank!');
return false;
}
if (document.formName.address.value == ''){
alert('Address can't be blank!');
return false;
}
if (document.formName.city.value == ''){
alert('City can't be blank!');
return false;
}
if (document.formName.state.value == ''){
alert('State can't be blank!');
return false;
}
return true;
Thanks.