Jump to content

JQuery Validation Engine - User Age Check


bravo14

Recommended Posts

Hi

 

I am using the jquery validation engine available from [url http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/]here[/url]

 

I have got it all implemented, however I want to create a rule that checks that a user trying to register is at least 18 years old, does anybody have any ideas how this can be done using jquery?

 

Any help would be greatly appreciated.

 

Mark

Link to comment
https://forums.phpfreaks.com/topic/248801-jquery-validation-engine-user-age-check/
Share on other sites

Build the date of birth from the current date and the birthday that the user provided.  Then use something like this: http://stackoverflow.com/questions/327429/whats-the-best-way-to-calculate-date-difference-in-javascript to calculate the difference between the two.

 

~juddster

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.