
Untitled
By: a guest on
Jul 24th, 2012 | syntax:
None | size: 0.61 KB | hits: 16 | expires: Never
Use another jQuery form validation plugin in Yii
<div id="error-message" style="display: none">
Please fill out all required fields!
</div>
$('form').walidate({
doIfSomethingIsInvalid: function() {
// will be executed after clicking the submit-button
// if a required input is empty.
$('#error-message').fadeIn().delay(2500).fadeOut();
}
});
$('.mail').walidate('validate', {
valid: function() {
$(this).next('.errorMsg').remove();
},
invalid: function() {
$(this).after('<em class="errorMsg">Please enter a valid e-mail adress</em>');
}
);