473,385 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Error on page on clicking button - maybe if statements problem

59
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="checkReg()">


Expand|Select|Wrap|Line Numbers
  1.  
  2. function checkReg(){
  3.     var Permit = true;
  4.     var R_oldpass = setup.oldpass.value;
  5.     var R_newpass = setup.newpass.value;
  6.     var R_vernewpass = setup.vernewpass.value;    
  7.     var R_EMAIL = setup.email.value;
  8.     var R_ShowLim = setup.ShowLim.value;    
  9.     var mas = "";
  10.     if(R_newpass) {
  11.         if(R_newpass||R_vernewpass)  {
  12.             mas += "password incorrect \n";    
  13.             Permit = false
  14.             }
  15.         }
  16.     if(R_EMAIL==''){
  17.         mas += "you must enter an email address \n";
  18.         Permit = false;
  19.         }   
  20.     else if((R_EMAIL.indexOf("@")==-1)||(R_EMAIL.indexOf(".")==-1)){
  21.         mas += "invalid email address \n";
  22.         Permit = false;
  23.         }
  24.     if(Permit){
  25.         hid.oldpass.value = R_oldpass;
  26.         hid.newpass.value = R_newpass;
  27.         hid.vernewpass.value = R_vernewpass;
  28.         hid.email.value = R_EMAIL;
  29.         hid.showlim.value = R_showlim;
  30.         hid.submit();
  31.         }
  32.     else
  33.         window.alert(mas);
  34.     }    
  35.  
Mar 6 '08 #1
4 1219
zivon
59
problam solved, thanks everyone.
Mar 6 '08 #2
acoder
16,027 Expert Mod 8TB
So what was the problem?
Mar 7 '08 #3
zivon
59
Case sensitive... lol..

insted of
Expand|Select|Wrap|Line Numbers
  1.  hid.showlim.value = R_showlim; 
this:
Expand|Select|Wrap|Line Numbers
  1.  hid.ShowLim.value = R_showlim; 


So what was the problem?
Mar 7 '08 #4
acoder
16,027 Expert Mod 8TB
Thanks for posting. Yes, that may have been easier to spot if you checked the error console (on a decent browser).
Mar 7 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Guy Hocking | last post by:
Hi there, First of all my apologies for seeming nieve and perhaps ignorant, i am new to ASP so forgive me. The Problem - I have an ASP page that has a number of list boxes in a form. These...
4
by: TG | last post by:
Hi, I have a question concerning redirecting users who have logged in using our login page. Once they have properly filled out the form they should be redirected back to the last page they were...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
7
by: saurabh | last post by:
Hey, I have a form in which there are say 10 fields. I am using validator control for all the fields. suppose user forgets to fill field no. 5, 8 , 9 and 10. So on clicking the save...
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
7
by: Schmidty | last post by:
Okay...I have another 'newbie' question; I have a function that loads a page and the action is $_SERVER; In the form that is in a function(method?) within a class a variable is passed back to...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.