hello i need help on my website, i need a function so that when someone enters their date of birth it displays there age in another textbox, but if the person is under 16 a message box shud appear saying u are not over age, message box shud have a ok button. i thought about doing it but ive got one form action which links to the database so if another form action is required how could it be done?? thanku

the date of bith format of textbox

<tr>
<td>Please enter your date of birth*<small>(dd/mm/yyyy</small></td>
<td><input type="text" name="DOB" maxlength="10" value="" /></td>
</tr>

Check this out. http://www.irt.org/script/29.htm . You can have an onblur event for the textbox and then call the function. You can validate if age < 16 in the function. If true, return false. Else continue.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.