'Validation in magento2 create account page
How to remove validation for "First Name" is a required value by programmatically in magento2. I tried with name.phtml for remove mandatory field and that's working fine and tried with change db value also that work also fine. but i need to enable and disable "First Name" is a required value from the backend. if anybody suggests me an idea for doing this it will be a great help for me.
Thanks in Advance
Solution 1:[1]
Remove validation from Login page: Copy login.phtml from below path:
vendor/magento/module-customer/view/frontend/templates/form/login.phtml
to your theme location:
app/design/frontend/[Vendor]/[theme]/Magento_Customer/templates/form/login.phtml
and remove the below code from the form: data-mage-init='{"validation":{}}'
Also, remove the data-validate from every field of that form.
Now you can add your custom validation according to your requirement.
Remove validation from Registration page: Copy register.phtml from below path:
vendor/magento/module-customer/view/frontend/templates/form/register.phtml
to your theme location:
app/design/frontend/[Vendor]/[theme]/Magento_Customer/templates/form/register.phtml
and remove the below code from the form: data-mage-init='{"validation":{}}'
Also, remove the data-validate from every field of that form.
Now you can add your custom validation according to your requirement.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | LitExtension Magento Migration |
