Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Validate Form Only Certain Fields

I have a function to validate all fields in a form:

validateForm: function() {
    var validator = new Validation(this.form);
    validator.validate();
}

There are two controls. First control need to validate only a,b,c fields. Second control need to validate only d,e,f fields. How can I achieve this?

like image 995
Jeaf Gilbert Avatar asked Apr 15 '11 16:04

Jeaf Gilbert


1 Answers

To validate only a certain field, you can use:

Validation.validate(document.getElementById(id));
like image 100
Luca Borrione Avatar answered Sep 19 '22 07:09

Luca Borrione