I can’t get why the same code isn’t working. I’m using devise gem, so all input names are the same.
My password confirmation didn’t work in other project.
Here is js code:
$('.sign_up').validate({
rules: {
'user[password]': {
required: true,
minlength: 6
},
'user[password_confirmation]': {
required: true,
minlength: 6,
equalTo: "#user_password"
}
}
My html code:
<label for="user_password">Password</label>
<input id="user_password" type="password" size="30" name="user[password]">
<label for="user_password_confirmation">Re-Type Password</label>
<input id="user_password_confirmation" type="password" size="30" name="user[password_confirmation]">
Where is problem ?
Try don’t use ”
and use the same word for input’s id and name.