Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I noticed your title references jQuery - and while I assume this question is dead thought I'd post this for anyone else coming along. This jQuery plugin is simple to use and pretty powerful. While a plugin is overkill to validate a single field it can be helpful if you have other validation (including required fields) on the same form. The below example is pulled from the docs. After initing the plugin you simply add classes of what validation to include. You can create customs one if you need it but its a little more complex.</p> <p><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a></p> <p>Usage is simple:</p> <pre><code>$("#commentForm").validate(); </code></pre> <p>form:</p> <pre><code>&lt;form class="cmxform" id="commentForm" method="post" action=""&gt; &lt;p&gt; &lt;label for="cname"&gt;Name&lt;/label&gt; &lt;em&gt;*&lt;/em&gt;&lt;input id="cname" name="name" size="25" class="required" minlength="2" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="cemail"&gt;E-Mail&lt;/label&gt; &lt;em&gt;*&lt;/em&gt;&lt;input id="cemail" name="email" size="25" class="required email" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="curl"&gt;URL&lt;/label&gt; &lt;em&gt; &lt;/em&gt;&lt;input id="curl" name="url" size="25" class="url" value="" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="ccomment"&gt;Your comment&lt;/label&gt; &lt;em&gt;*&lt;/em&gt;&lt;textarea id="ccomment" name="comment" cols="22" class="required"&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;p&gt; &lt;input class="submit" type="submit" value="Submit"/&gt; &lt;/p&gt; &lt;/form&gt; </code></pre> <p>And thats it XD</p>
 

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