I want to create a date input with the widget => single_text
type, but I only want the user to be able to select/type years between 2000 and 2099. With widget => choice
this works fine, but with single_text
I can write the number I want despite clearly having the range attribute set. Is there a quick way to accomplish this, or do I have to create some other validation? If so, how?
My code:
... ['respiteDate', DateType::class, [
'required' => false,
'widget' => 'single_text',
'years' => range(2000,2099)
],
], ...
Thanks in advance.