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="checkReg()">
Expand|Select|Wrap|Line Numbers
- 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);
- }