Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Based on this answer <a href="https://stackoverflow.com/questions/2056406/validating-broken-up-date-width-jquery-validation-plugin">Validating broken up date width jQuery Validation plugin</a></p> <pre><code>&lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="jquery.validate.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form" name="form"&gt; &lt;select name="day" id="day"&gt; &lt;option value=""&gt;DD&lt;/option&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;/select&gt; &lt;select name="month" id="month"&gt; &lt;option value=""&gt;MM&lt;/option&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;/select&gt; &lt;select name="year" id="year"&gt; &lt;option value=""&gt;YYYY&lt;/option&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" id="sub"/&gt; &lt;/form&gt; &lt;script&gt; $(function() { // this function requires month day and year selections $.validator.addMethod("FullDate", function() { //if all values are selected if($("#day").val() != "" &amp;&amp; $("#month").val() != "" &amp;&amp; $("#year").val() != "") { return true; } else { return false; } }, 'errrr'); $("form").validate({ success: function(em) { em.html("winner").addClass("valid"); }, rules: { day: "FullDate", month: "FullDate", year: "FullDate" }, groups:{ dateofbirth:"day month year" }, errorPlacement:function(error,element){ error.insertAfter('#sub'); } }); }); &lt;/script&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    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