2

Possible Duplicate:
How do I verify age using jQuery?

I need to implement this FORM by having three inputs instead than one. Currently I have only one input.

but I need:

<input type="text" name="DAY" />
<input type="text" name="MONTH" />
<input type="text" name="YEAR" />
<label><input type="checkbox" name="checkbox" />remember me</label>

and quite importantly I need a remember me checkbox. and the Submit button should like to the next page. "enter.php"

Guys is not laziness but just not enough $ skills:-(

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="http://www.mypokerpartner.com/cookie.js"></script>
<script type="text/javascript" src="http://www.mypokerpartner.com/timeAgo.js"></script>
<script type="text/javascript" src="http://www.mypokerpartner.com/maskedInput.js"></script>

 $('input[name="DOB"]').mask("99/99/9999");
$('.deleteCookie').click(function() {
    $.cookie('age', null);
});
$('.submit').click(function() {
    var age = jQuery.timeago($('input[name="DOB"]').val());
    if (age === 'NaN years ago') {
        alert('DOB must be valid');
    } else {
        $.cookie('age', age);
        if (parseInt(age, 10) >= 21) {
            alert('you\'re of age');
        } else {
            alert('you\'re too young');
        }
    }
});

if (null !== $.cookie('age')) {
    alert('saved Cookie ' + $.cookie('age'));
}


<input type="text" name="DOB" />
<a href="javascript:void(0)" class="submit">Submit</a><br /><br />
<a href="javascript:void(0)" class="deleteCookie">Delete Cookie</a><br /><br />
Community
  • 1
  • 1

0 Answers0