vivin / regula

Regula: An annotation-based form-validation framework in Javascript
126 stars 24 forks source link

Run.validate should not always throw error on unbound constraints #41

Closed saunders99999 closed 11 years ago

saunders99999 commented 11 years ago

I have a tree of elements, and want to run validation on element A and its descendants A->B1->C(constraint) A->B2(constraint)

Use Case 1 - all is well when running validate on all constraints in Tree A

Use Case 2 - ERROR when running validate on select constraints in Tree A

To help support select validation of Tree A. I am requesting that either

I would think Regula.bind and Regula.unbind is a good way to turn on/off constraints during validation checks.

vivin commented 11 years ago

I think a state-inspection method like regula.isBound(...) would make sense. This is the typical way to check to see if a situation could potentially throw an exception. Thank you for bringing this to my attention. :) I will commit a fix as soon as I can.