I have a field of type date
, with name txtdata_nasc
. I need a validation for it. I need you to have a button on his side that can validate it.
If a person enters a birthday under the age of 18, I want a alert("Pessoas menores de 18 não podem se cadastrar.")
to appear, and if he enters a birthday between the ages of 18 and 60, that appears alert("Maior de 18, pode se cadastrar.")
. The person can not put a date that makes it to be more than 60 years.
Please, I want this code to return on a button with onclick='return validadata()'
as for example.