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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -