validation - Determine if a form element has any validators attached -
is possible determine if form element has validator attached? example...
<input type='text' required />
<--- has validator
<input type='text'/>
<--- has none
i have directive assigns image depending on whether valid or not @ moment showing valid when there no validator rules assigned.
you're in directive:
var link = function(scope, ielement, iattrs) {}
couldn't check iattrs.required
?
alternatively, i'd implement angular's ng-required
directive on inputs, check $dirty , $invalid flags on form. check fiddle more info: http://jsfiddle.net/euqtn/
Comments
Post a Comment