jbojcic
jbojcic

Reputation: 973

Parsley v2.0.0-rc2 prevent disabled fields validation

How to prevent Parsley v2.0.0-rc2 from validating disabled fields? In previous version disabled fields were ignored by default.

Upvotes: 4

Views: 3140

Answers (2)

Jose Villalobos
Jose Villalobos

Reputation: 373

You can avoid parsley validation by typing this in the form element:

data-parsley-excluded="[disabled=disabled]"

You can set any type of jquery selector to exclude from validation.

Upvotes: 10

jemiloii
jemiloii

Reputation: 25759

http://parsleyjs.org/doc/index.html#psly-usage-field

You should look at the parsley documentation and use groups. You can set certain fields to be validated and submitted so that you don't have to validate everything, such as login section of a form that is also a part of a signup form.

Upvotes: 0

Related Questions