I\'ve been looking around for a solution to this, but can\'t seem to find any examples that work for me. Here\'s what I\'ve got so far:
$(\"#register-form\")
$("#register-form").submit(function() {
$('.required input').each(function() {
if ($($this).val() == '') {
$(this).addClass('highlight');
}
});
if ($('.required input').hasClass('highlight')) {
alert("Please fill in all the required fields (indicated by *)");
return false;
}
}
Give that a shot.
EDIT Moved the alert so users don't get their faces blown off with alert messages, good catch.