Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

&& not working 1

Status
Not open for further replies.

JSMITH242B

Programmer
Mar 7, 2003
352
GB
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);
}
 
Thanks cLFlaVA,
I just found this out on the javascript forum!!

cheers for responding so quick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top