Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Use another jQuery form validation plugin in Yii
  2. <div id="error-message" style="display: none">
  3.     Please fill out all required fields!
  4. </div>
  5.        
  6. $('form').walidate({
  7.     doIfSomethingIsInvalid: function() {
  8.         // will be executed after clicking the submit-button
  9.         // if a required input is empty.
  10.         $('#error-message').fadeIn().delay(2500).fadeOut();
  11.     }
  12. });
  13.        
  14. $('.mail').walidate('validate', {
  15.     valid: function() {
  16.         $(this).next('.errorMsg').remove();
  17.     },
  18.     invalid: function() {
  19.         $(this).after('<em class="errorMsg">Please enter a valid e-mail adress</em>');
  20.     }
  21. );