Angularjs dropdownlist and form validation -


i have page several dropdown lists , of them may have default entries not valid. it's same problem described here: angularjs doesn't validate invalid dropdown selection

however, think there has reasonable way accomplish without having check manually in controller. i'd able this:

<select ng-model="thisentry" ng-options="option option in goodoptions"></select> <span class="error" ng-show="goodoptions.indexof(thisentry) == -1">please select valid entry list</span> 

that sets form invalid user can't submit until it's fixed . code above displays message, don't know how set form invalid @ same time, or in equivalent line of code. seems equivalent of blank entry on form that's handled without having resort javascript code.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -