Error on page on clicking button - maybe if statements problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zivon
    New Member
    • Aug 2007
    • 59

    Error on page on clicking button - maybe if statements problem

    actully, I have no idea how to describe the problam, and I can't find it aswell...

    I have a botton which call a javascript function.. and for some reasone it writes: "Error on page" when I click on the botton.

    if I remove all the if statments from the function it works just fine...
    I hope someone could help me out and find what the problam is..

    thanks in advance,
    Idan

    <INPUT type="button" value="Update" name="update" onclick="checkR eg()">


    Code:
    function checkReg(){
    	var Permit = true;
    	var R_oldpass = setup.oldpass.value;
    	var R_newpass = setup.newpass.value;
    	var R_vernewpass = setup.vernewpass.value;	
    	var R_EMAIL = setup.email.value;
    	var R_ShowLim = setup.ShowLim.value;	
    	var mas = "";
    	if(R_newpass) {
    		if(R_newpass||R_vernewpass)  {
    			mas += "password incorrect \n";	
    			Permit = false
    			}
    		}
    	if(R_EMAIL==''){
    		mas += "you must enter an email address \n";
    		Permit = false;
    		}   
    	else if((R_EMAIL.indexOf("@")==-1)||(R_EMAIL.indexOf(".")==-1)){
    		mas += "invalid email address \n";
    		Permit = false;
    		}
    	if(Permit){
    		hid.oldpass.value = R_oldpass;
    		hid.newpass.value = R_newpass;
    		hid.vernewpass.value = R_vernewpass;
    		hid.email.value = R_EMAIL;
    		hid.showlim.value = R_showlim;
    		hid.submit();
    		}
    	else
    		window.alert(mas);
    	}
  • zivon
    New Member
    • Aug 2007
    • 59

    #2
    problam solved, thanks everyone.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      So what was the problem?

      Comment

      • zivon
        New Member
        • Aug 2007
        • 59

        #4
        Case sensitive... lol..

        insted of
        Code:
         hid.showlim.value = R_showlim;
        this:
        Code:
         hid.ShowLim.value = R_showlim;


        Originally posted by acoder
        So what was the problem?

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Thanks for posting. Yes, that may have been easier to spot if you checked the error console (on a decent browser).

          Comment

          Working...