On Fri, 04 Apr 2008 13:19:12 -0700, laredotornado wrote:
Hi,
Given select menus named birthMonth, birthDay, and birthYear, how do I
check if the user has selected values such that he/she is at least 18
years old?
Thanks, - Dave
Like the others said, you can't.
If you must, you can get the system date from Javascript and extract out
the day and month and compare those values, then compare the year.
Its not worth the effort, however. Any time I see one of those boxes I
just put my mouse over the 'year' select box and start scrolling down
till I know I'm in the clear. I suspect that most users will do
something similar.
Even if you could be 100% sure they would enter their actual birthday,
you *still* can't trust it. Unless you are going to get the time/date
from another source, the system clock can be changed. In less than a
dozen mouse clicks I can have my machine thinking its 2040.