Edgar Navasardyan Edgar Navasardyan - 1 month ago 6
Javascript Question

Parsley's EXCLUDED not recognizing :last

I am trying to make Parlsley validate all the rows in the table except the last one, and it seems to ignore me )

$('form').parsley({
excluded: 'tr:last'
}).validate();


Here's the JSFIddle

Any ideas ?

Answer

excluded works by filtering your inputs, i.e:

$yourForm.find(inputs).not(excluded)`

It does not "redo" the search from the form level, i.e. it does not do:

$yourForm.find(inputs).not($yourForm.find(excluded))  # *Not* the way Parsley treats `excluded`

Your excluded selector is thus ineffective.