All pastes #131031 Raw Edit

Stuff

public javascript v1 · immutable
#131031 ·published 2006-08-14 09:01 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />	<script language="javascript">		function checkAge()		{			/* the minumum age you want to allow in */			var min_age = 18;			/* change "age_form" to whatever your form has for a name="..." */			var year = parseInt(document.forms["age_form"]["year"].value);			var month = parseInt(document.forms["age_form"]["month"].value) - 1;			var day = parseInt(document.forms["age_form"]["day"].value);			var theirDate = new Date((year + min_age), month, day);			var today = new Date;			if ( (today.getTime() - theirDate.getTime()) < 0) {				alert("You are too young to enter this site!");				return false;			}			else {				return true;			}		}	</script>	<title>Untitled Document</title><style type="text/css"><!--body,td,th {	font-family: Verdana, Arial, Helvetica, sans-serif;	font-size: 9px;	color: #FFFFFF;}body {	background-color: #000000;}--></style></head><body><div align="center">  <table width="200" border="0">    <tr>      <td><form name="age_form" method="get">        <label>          <input type="text" name="month" />          </label>        <p>          <input type="text" name="day" />        </p>        <p>          <input type="text" name="year" /></p><input name="_send_date_" value="Go" onClick="return checkAge()" type="submit">      </form>      </td>    </tr>  </table></div></body></html>