I have an input type date like
<input type="date" />
I don’t want users to be able to change the date manually, but require them to use the button provided for.
So I did
<input type="date" onkeydown="return false"/>
No problem with Chrome but it don’t work with Fierfox.
Have you a solution pls ?
2
Answers
you can just add
readonly
attribute:sorry, now i understand what do you want.
you’re right onkeydown="return false" does not work on firefox because firefox does not care about the return of this function unlike other browsers (neither onkeyup).
you can acheive what you want by prevent the user from focusing the input, like this: