[jQuery] Jquery plugin validation remote option
$(document).ready(function() {
var valprod = $("#frmProduct").validate({
onkeyup:false,
rules: {
txtProduct:{
required: true,
minlength: 4,
productCheck: true
}
}
});
valprod.resetForm();
});
jQuery.validator.addMethod('productCheck', function(productname) {
var postURL = "product/confirm_prod";
$.ajax({
cache:false,
async:false,
type: "POST",
data: "txtProduct=" + productname,
url: postURL,
success: function(msg) {
result = (msg=='TRUE') ? true : false;
},
});
return result;
}, 'Record Found'
);
my only issue is whenever 1st time it checks the record if found
record it display message Record Found but whenever i try to change my
textbox value it still gives me this message. it does not get reset if
record not found.