Good everyone, I had the following question, can it be done that when a input type="date
" more than 65 years have passed between today's date and the one that users put, a will be deactivated input type="radio"
?
That is, first of all I need to get the value of the "date" field, and then subtract the date entered from today's date, and if it is greater than 65 years of difference, a radio type field is deactivated, would that be possible?
There you have the HTML and Javascript code. I think it's clear but if you have doubts ask ^^
Instead of a button, you can make an OnChange event of the
type="date"
The calculation that appears in the IF is because the result is given in milliseconds and I pass it to years.
The JavaScript code (with some jQuery ) would look like this:
To load jQuery in your document don't forget to add it in the tag
<head>
If you don't understand any part of the code feel free to ask.