bboyle / form-validation

Validation UI for web forms
MIT License
2 stars 1 forks source link

provide a way to update UI for a specific question #16

Closed bboyle closed 12 years ago

bboyle commented 12 years ago

For example: a required field may be display as invalid. The underlying @required might be toggled to make the field valid. There needs to be a way to update the UI to reflect this.

Consider:

$( '.invalid input' ).each(function() {
   this.removeAttribute('required');
}).forcesForms( 'checkValidity' );

where forcesForms( 'checkValidity' ) calls the .checkValidity() on the underlying DOM elements, and then updates the UI.

bboyle commented 12 years ago

what's wrong with .trigger( 'change' )? Toggling required feels like a ‘change’ to me :)