0
我正在使用jquery驗證插件。如何在驗證插件中添加自定義錯誤替換。如何使用jquery驗證插件添加自定義錯誤替換?
<script src="<?php echo base_url(); ?>application/js/jquery.validate.js">
</script>
<script type="text/javascript">
$("#validation-form").validate({
errorPlacement: function(error, element) {
$("p.field_validation_error").removeClass("field_validation_error hidden");
error.appendTo('field_validation_error');
},
rules: {
old_password: "required",
minlength: 2
},
messages: {
old_password: "Please enter your firstname",
minlength: "Your username must consist of at least 2 characters"
}
})
</script>
<input type="password" name="old_password" id="old_password" autofocus>
<p class="field_validation_error hidden">Please enter a password...</p>
如何刪除隱藏類和自定義錯誤replacment jQuery的添加類field_validation_error