I have added custom form in customer account navigation.
Looking for code to form validation.
is there anything like form-validate like in magento1?
I have used in magento1 like below.
var dataForm = new VarienForm('form-validate', true);
Like that anything is there in magento2? How can we do form validation in magento 2?
Best Answer
I have managed to add form validation to custom form by following code:
You need to add data-validate to every input fields where you want validation like below which means value is required and also validate email validation: