代码如下:
$('#contactForm').submit(function () {
$.each($('#contactForm .notShouldBeBlank'), function()
{
if($(this).val() == ''){
$(this).after('<span class="error">This field is required.</span>');
}
});
// Other groups validated here
}