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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
I keep getting an error while validating my form. I can't see what i have missed.
the names are correct


Code:
<script type="text/javascript" language="JavaScript">
function validateForm() {
with (document.MyForm) {
var alertMsg = "Please fill in the following before searching:\n";

if ((Specialty.selectedIndex==0 )||(Specialty2.selectedIndex==0)) {alertMsg += "\n- Speciality";}

if (city.selectedIndex==0 && zip.value=="")||(city2.selectedIndex==0 && zip2.value=="") {alertMsg += "\n- City or Zip";}[COLOR=#ff0000]Error This Line[/color]

if (alertMsg != "Please fill in the following before searching:\n") {
	alert(alertMsg);
	return false;
} else {
return true;
} } }
</script>
 
[tt]if [highlight]([/highlight](city.selectedIndex==0 && zip.value=="")||(city2.selectedIndex==0 && zip2.value=="")[highlight])[/highlight] {alertMsg += "\n- City or Zip";}[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top