Estoy usando el plugin de
http://docs.jquery.com/Plugins/Validation pero no puedo hacer que ande el equalTo.
Ingreso ambas passwords iguales sin embargo siempre me tira error diciendo que la password debe ser igual a la anterior.
Código javascript
:
Ver original<script type="text/javascript">
$().ready(function() {
$("#register").validate({
rules: {
user: {
required: true,
minlength: 3,
maxlength: 25
},
pass: {
required: true,
minlength: 5,
maxlength: 50
},
passconf: {
required: true,
minlength: 5,
maxlength: 50,
equalTo: "#pass"
},
mail: {
required: true,
email: true
},
},
messages: {
user: {
required: "Please enter a username.",
minlength: "Your username must consist of at least 3 characters."
},
pass: {
required: "Please provide a password.",
minlength: "Your password must be at least 5 characters long."
},
passconf: {
required: "Please provide a password.",
minlength: "Your password must be at least 5 characters long",
equalTo: "Please enter the same password as above."
},
mail: {
required: "Please provide a email."
}
}
});
});
</script>
Código html:
Ver original<input type="text" name="user" value="<?php echo set_value('username'); ?>" size="25" class="input"/>
<input type="password" name="pass" value="<?php echo set_value('password'); ?>" size="25" class="input"/>
<input type="password" name="passconf" value="<?php echo set_value('passconf'); ?>" size="25" class="input"/>
<input type="text" name="mail" value="<?php echo set_value('mail'); ?>" size="25" class="input"/>
<input class="button" type="submit" />