I have a form here when you press “Click To Test Signup” : http://www.problemio.com/test.php
If you enter all the fields, it gives you a password error. The reason for that being that on the JS validation side, the password field somehow can’t be retrieved. Here is the part of my form:
<p>
<label for="name"><span>Password (5+ Characters):</span></label> <input type="password" id="user_pass" name="user_pass" >
</p>
<p id="password_error" style="display:none;">
<span class="error">The password must be over 5 characters.</span>
</p>
<p>
<label for="name"><span>Password Confirm:</span></label> <input type="password" id="user_pass_check" name="user_pass_check">
</p>
<p id="password_confirm_error" style="display:none;">
<span class="error">The passwords must match</span>
</p>
and here is how I retrieve the parameters:
var password = $("#user_pass").val();
var pass_confirm = $("#user_pass_check").val();
alert ("password: " + password);
alert ("pass_confirm: " + pass_confirm);
the password confirm field actually gets the parameter ok, but the password field is always undefined or empty. Any idea why that is happening here?
Thanks!
Your page has two password fields with same ID ‘user_pass’, one in signup form and another in login form, Use different IDs and there ‘ll be no issue.