0
I got a field like date
, by name txtdata_nasc
. I need a validation for it. I need you to have a button next to it that can validate it.
If a person enters a birth date under 18 years of age, I want a alert("Pessoas menores de 18 não podem se cadastrar.")
, and if he enters a date of birth between the ages of 18 and 60 alert("Maior de 18, pode se cadastrar.")
. You can’t put a date that makes you over 60.
Please, I want such code to return on a button with the onclick='return validadata()'
as an example.
Why a button on the side of the field ? Why don’t you just leave the sign up button and validate when submitting or else try using jquery the focus function in the field instead of the button, if it were I would validate with jquery very easy and practical since it uses Ajax.
– user112919
and how I would do that?
– sdkamda2323
my sign up button is this: <input type="Submit" value="Register" name="btn1" onclick="Return validatyname();"> only q it already has a function like Return, and I don’t know how to use more than one Return...
– sdkamda2323
Related question: https://answall.com/q/297935/132
– Victor Stafusa
That answer can help you
– bio