0
HELP: I used JavaScript to autogenerate age from date of birth in a html form
now i want to check if the age is over a certain number in order to move from the form page to another page. any ideas?
6 ответов
0
like this ? i dont quite understand what you mean
if(age>limit){
//movesomewhere
}
0
Taste this is the code. I want to enable submit button only if age is greater 18 and less than 101. https://code.sololearn.com/W84JjkrYU52d/?ref=app
0
yours are fine, jut change the age limit from 9 to 18 and 12 to 101
the only error are location.href should be window.location.href
and why did you need a submit button if the page is redirect automaticly ?
0
Taste I just had it because the JavaScript wasn't redirecting.
0
yep, use window.location.href
not location.href
0
Taste thank you!