I use Jquery form validation. Before visitor submit i need to check the 'Terms&Cond' checkbox. If not checked i would like to see the message an alert box. (other messages shown near in the textboxes)
How to set this? I try this:
$("#myform").validate({
errorPlacement: function(error, element) {
if ( element.is(":checkbox") ) {
alert(error.html());
}
},
rules: {
name: {
required: true,
minlength: 3,
maxlength: 40,
lettersonly: false
},
ad: {
.....
But this did not work.
Thank you for help.
error
does not have a html() function. You were probably trying to alert the markup of the element.