Q:

validation of password field using a compare to string method or using an == but both not working

iam trying to validate the password field with the re-type password field but its not working :
function Signup() {

    alert('step one')
    var q=SignUppasswordField.val();
    var z=SignUpRetypepasswordField.val();

    if(q.toString()==z.toString()){

        alert('valid')
        var name= $('#SignUpName').val();
        var UserName=$('#SignUpUserName').val();
        var UserPassword=$('#SignUppasswordField').val();
        var EmailAddress=$('#SignUpEmail').val();
        callServer('successAdd','checkConnection',false,'addMember.php',{name:name,UserName:UserName,UserPassword:UserPassword,EmailAddress:EmailAddress});
    }

    else {

        alert('not valid');
        alert("please check entered info.")
    }

}

A:

I think you will need to use JQuery selector when assigning q and z using JQuery val()
Or put another way, val() is not defined for HTML DOM ELEMENT
var q=$('#SignUppasswordField').val();
var z=$('#SignUpRetypepasswordField').val();

