【发布时间】:2014-10-20 12:16:06
【问题描述】:
我的页面上有以下 HTML,其中有 2 个 select 元素。我希望它们都是必需的。我希望第二个元素 currentModel 保持禁用状态,直到使用除 Year 以外的值选择第一个元素,这是我的默认值。
<select class="form-control input-xsmall select-inline" data-ng-model="currentYear" >
<option>Year</option>
<option ng-repeat="year in years" value="{{year}}">{{year}}</option>
</select>
<select class="form-control input-xsmall select-inline" data-ng-model="currentModel">
<option>Model</option>
<option ng-repeat="model in models" value="{{model.niceName}}">{{model.name}}</option>
</select>
有人可以帮助我如何验证这样的选择元素吗?
【问题讨论】:
标签: html angularjs select angularjs-validation