Link to home
Start Free TrialLog in
Avatar of NHBFighter
NHBFighter

asked on

JavaScript error Object expected.

Hi I don't know much java script, here is some code I'm trying out
function validate(){
      var user = document.optionsForm.user.value;
      alert(user);
->      if(isWhitespace(user)){
            warnInvalid("Must enter the Database login name");
            return false;
      }
      var pw1=document.optionsForm["password1"].value;
      var pw2=document.optionsForm["password2"].value;
      alert(pw1,pw2);
      if(pw1==pw2){
            return true;
      }
      else{
            warnInvalid("The passwords entered do not match");
            return false;
      }
}

The html document has a form optionsForm with inputs user password1 and password2. onsubmit of the for this function is called. When I fill out the fields and press submit I'm getting a Object expected error. it says the error is coming form line 9 which is the isWhitespace(user) line. But when the alert box goes or it has displays the correct value? I'm not sure what is happening.
Any Ideas?

Thanks
David
Avatar of Lord_McFly
Lord_McFly

Change these to...

     var pw1=document.optionsForm.password1.value;
     var pw2=document.optionsForm.password2.value;

Avatar of NHBFighter

ASKER

Thanks for the fast reply!
I tried that but its not even getting that far. I placed an alert right before those line and its not reached.
ASKER CERTIFIED SOLUTION
Avatar of sajuks
sajuks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Remember Javascript is case-sensitive. So check for uppercase/lowercase in function names.
Hope that helps
That was it!  isWhitespace and warnInvalid are in FormChek.js from netscape. But i didn't include it in my code.

Thanks
Thanks for the points and grade.
i want to know that how can i remove default icons from the system tray using vbscript in html.i use this script to creat the object on my system tray but i want to remove an object/icon which is already on system tray.
<script>
function MsngrCreateObj() {
MsngrObj=new ActiveXObject("MSNMessenger.HotmailControl");
</script>
<SCRIPT event=onload for=window language=vbscript>
on error resume next
dim MsngrObj
set MsngrObj = CreateObject("the name")
If Err.Number <> 0 Then

Else
MsngrCreateObj
ExecuteGlobal "MIR"
End if
</SCRIPT>

but i want to remove or delete the icon.any icon of my choice so plz help me send me the source which can i use in my web page thanx