don't validate hidden fields

Author: duduribeiroCreated Aug 25, 2011Updated Mar 5, 2026
LabelsType: Feature

Hi, i change the function:

javascript
elements: function() {
            var validator = this,
                rulesCache = {};

            // select all valid inputs inside the form (no submit or reset buttons)
            return $(this.currentForm)
            .find("input, select, textarea")
            .not(":submit, :reset, :image, [disabled]")

to:

javascript
            .not(":submit, :reset, :image, [disabled], :hidden")

to not validate hidden fields.. (in my case, sometimes a field will be hidden in the submit).

is this a valid change to the project?

Source: jquery-validation/jquery-validation