I want to remove default validation from login and registration form and add my custom validation in magento2.2.5?
1 Answer
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 the every fields 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 the every fields of that form.
Now you can add your custom validation according to your requirement.
-
-
I have checked it in local system and its working fine for me. Can you check if some module extended that file. Apr 26, 2019 at 14:39
-
Now it is working. but after submitting my login form, the form is just being loaded. It is not logging in.– AmyApr 27, 2019 at 5:40
-
-