Hi I am using jQuery Form Validation Plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/
And I know that the default text is using "This field is required." And I am wanting to replace it with an IMG tag. But I don't want to change it within the actual PLUGIN, and wondering if it can be done just generically through the plugin options. I have tried many variations but have come up with this cut-down version.
$(document).ready(function(e) {
$("#validationTest").validate({
rules: {
defaults: {
messages: {required: "<img src='images/required.png' />"}
}
},
submitHandler: function(form) {
$(form).submit();
}
})
});
But this still doesn't work... any thoughts or direction would be appreciated.
You mean like this:
$(document).ready(function(){
$('#field').validate({
rules: {
f1: "required"
},
messages: {
f1: "<img src='images/icons-coquette/accept.png' />"
}
})
});
for all try $.extend
$.extend(
$.validator.messages, {
required: "put your message here" //or put <img /> tag
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With