Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As for the Age Validation piece, try this:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script src="http://cloud.github.com/downloads/digitalBush/jquery.maskedinput/jquery.maskedinput-1.3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $(function() { $("#frm-verify-age").submit(function(){ var age = 18; var mydate = new Date($("#bday").val()); mydate.setFullYear(mydate.getFullYear()); var currdate = new Date(); currdate.setFullYear(currdate.getFullYear() - age); if ((currdate - mydate) &lt; 0){ alert("Sorry, only persons over the age of " + age + " may enter this site"); return false; } return true; }); $("#bday").datepicker({ buttonText: 'Choose a Date' }); $("#bday").mask("99/99/9999"); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="frm-verify-age" id="frm-verify-age"&gt; Birthdate &lt;input style="background-color:#FFFFa0" type="text" id="bday" name="bday" size="12" /&gt; &lt;input name="frm-verify-submit" id="frm-verify-submit" type="submit" value="submit" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>For the Cookie Saving: <a href="https://github.com/carhartl/jquery-cookie" rel="nofollow">https://github.com/carhartl/jquery-cookie</a></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