如何在用户更改动态选择选项时设置选择的最小长度和最大长度?

时间:2014-08-24 13:13:00

标签: javascript angularjs

这里我添加了我的角度js代码。如果我更改select并设置输入的最小值和最大值,我可以这样做吗?

<div class="form-group" data-ng-repeat="field in fields">
              <span class="ui-select">
                  <select >
                      <option value="Small" ng-selected="'small' === '{{field['font-size']}}'">Small</option>
                      <option value="Medium" ng-selected="'medium' === '{{field['font-size']}}'">Medium</option>
                      <option value="Large" ng-selected="'large' === '{{field['font-size']}}'">Large</option>
                  </select>
              </span>
              <span class="ui-select">
                  <select onchange="changeoption">
                      <option value="Bold" ng-selected="'bold' === '{{field['font-weight']}}'">Bold</option>
                      <option value="Regular" ng-selected="'regular' === '{{field['font-weight']}}'">Regular</option>
                      <option value="Null" ng-selected="'null' === '{{field['font-weight']}}'">Null</option>
                  </select>
              </span>             

              <input type="text" class="form-control" minlength='0' maxlength="40" placeholder="{{field.id}}">
            </div> 

请在这里找个小提琴

fiddle

0 个答案:

没有答案