I want to limit the dob field in account creation form to be not less than 01/01/1900.
I thought 2 way:
– limit the calendar widget (but maybe someone could input the date directly)
– add a validation to the dob field
The first way seems not to be secure, so i decide to follow the second one.
I found there is a validation class "validate-date-range" which seems to do what i need, but i can't find how to use it (how can i pass the initial date parameter?)
Moreover, I don't know how to add the validation to the dob field in the account create form.
I try to modify the file
vendor/magento/module-customer/view/base/ui_component/customer_form.xml
but i can't see change in the frontend code.
Any help?!?
Best Answer
Then you need to override the block file and make changes for the validation.
vendor/magento/module-customer/Block/Widget/Dob.php
You can add your custom validation in above function.