JSMITH242B
Programmer
Hi Group,
I have 4 input boxes on my Search form.
The user hs to enter either the surname and postcode OR surname and at least 5 char in street
I have the following bit of code for the surname and postcode validation. On testing however I found that I can enter in the surname ONLY and the alert message is not displayed. The user should be prompted for the surname AND the postcode. Becuase of this, I haven't added the validation for the surname and street. I presume it will be an else as part of the statement below.
Can anyone help me out? I'm new to javascript.
if ( document.frmsearch.surname.value == '' && document.frmsearch.postcode.value == '')
{
alert("Please enter at least the following information Surname and PostCode");
return(false);
}
I have 4 input boxes on my Search form.
The user hs to enter either the surname and postcode OR surname and at least 5 char in street
I have the following bit of code for the surname and postcode validation. On testing however I found that I can enter in the surname ONLY and the alert message is not displayed. The user should be prompted for the surname AND the postcode. Becuase of this, I haven't added the validation for the surname and street. I presume it will be an else as part of the statement below.
Can anyone help me out? I'm new to javascript.
if ( document.frmsearch.surname.value == '' && document.frmsearch.postcode.value == '')
{
alert("Please enter at least the following information Surname and PostCode");
return(false);
}