javascript - validation of password field using a compare to string method or using an == but both not working -
iam trying validate password field re-type password field 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.") } }
i think need use jquery selector when assigning q , z using jquery val()
or put way, val() not defined html dom element
var q=$('#signuppasswordfield').val(); var z=$('#signupretypepasswordfield').val();
Comments
Post a Comment