Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Expected Identifier problem

    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.
    Code:
    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;
    	}
    }

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that was it, thanks a lot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •