Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://jsfiddle.net/MgcDU/2890/">JSFiddler Example</a></p> <p>This will validate as you leave each field or when you hit the submit button all fields that meet the rules will present errors.</p> <p>HTML</p> <pre><code>&lt;form action="" id="fvujq-form1" class="form-horizontal"&gt; &lt;fieldset&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="name"&gt;Your Name&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" class="input-xlarge" name="name" id="name"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="email"&gt;Email Address&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" class="input-xlarge" name="email" id="email"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="comment"&gt;Comment&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" class="input-xlarge" name="comment" id="comment"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-actions"&gt; &lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>Javascript</p> <pre><code>$(document).ready(function(){ $('#fvujq-form1').validate( { rules: { name: { minlength: 2, required: true }, email: { required: true, email: true }, comment: { minlength: 2, required: true }, }, highlight: function(element) { $(element).closest('.control-group').removeClass('success').addClass('error'); }, success: function(element) { element .text('OK!').addClass('valid') .closest('.control-group').removeClass('error').addClass('success'); } }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload