...

View Full Version : Expected Identifier problem



mhunt
01-11-2007, 04:02 PM
This works perfectly fine in firefox but i need it to work in IE
the form variable names are all correct and everything but in Ie it keeps telling me when i submit the form that there is an Expected Identifier problem.


function checkForm() {
//Form variables;
var myform = document.students;
var org = myform.organization.value;
var super = myform.supervisor.value;
var fname = myform.fname.value;
var lname = myform.lname.value;
var email = myform.email.value;
var address1 = myform.address1.value;
var city = myform.city.value;
var state = myform.state.value;
var zipcode = myform.zipcode.value;
var phone1 = myform.phone1.value;

if(!org || org == "") {
alert("You must have an organization.");
return false;
}
if(!super || super == "") {
alert("You must have a supervisor.");
return false;
}
if(!fname || fname == "") {
alert("You must have a first name.");
return false;
}
if(!lname || lname == "") {
alert("You must have a last name.");
return false;
}
if(!email || email == "") {
alert("You must have an email.");
return false
}
if(email != "") {
if(email.indexOf('@') == -1) {
alert("You must enter a valid email address.");
return false;
}
}
if(!address1 || address1 == "") {
alert("You must have a Primary address.");
return false;
}
if(!city || city == "") {
alert("You must have a City.");
return false;
}
if(!state || state == "") {
alert("You must have a State.");
return false;
}
if(!zipcode || zipcode == "") {
alert("You must fill in a zipcode.");
return false;
}
if(zipcode != "") {
if(zipcode.length != 5 && zipcode.length != 10) {
alert("You must enter the 5 digit or 9 digit zip code");
return false;
}
for(i=0; i<5; i++) {
if(zipcode.charAt(i)<0) {
alert("The first five digits must be numeric.");
return false;
}
}
}
if(!phone1 || phone1 == "") {
alert("You must have a Primary phone.");
return false;
}
}

david_kw
01-11-2007, 04:57 PM
Try changing

var super = myform.supervisor.value;

to

var superv = myform.supervisor.value;

since I believe super is a reserved word.

That may not be your problem but it is a problem.

david_kw

mhunt
01-11-2007, 05:03 PM
that was it, thanks a lot



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum