Magento Validate Form Only Certain Fields

11,032

To validate only a certain field, you can use:

Validation.validate(document.getElementById(id));
Share:
11,032
Jeaf Gilbert
Author by

Jeaf Gilbert

Full-stack Developer (PHP, HTML, CSS, Javascript, MySQL)

Updated on June 09, 2022

Comments

  • Jeaf Gilbert
    Jeaf Gilbert about 2 years

    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?

  • Xiaokun
    Xiaokun almost 8 years
    what is Validation ?
  • Shadoweb
    Shadoweb over 6 years
    @Xiaokun Validation is the prototype class you will find in js/prototype/validation.js