当"其他"时,选中单选按钮单击文本框

时间:2014-08-15 06:00:16

标签: angularjs radio-button

我有一组简单的单选按钮渲染如下:

< div ng-repeat='option in quest.opts' >
                    <input  type="radio" ng-name='{{quest.id}}' ng-model='$parent.$parent.choice.input'  ng-value='{{option}}' id='{{quest.id}}-{{option.id}}' ng-required='required'>
                    <label class="labelStyle ansMargin"  for='{{quest.id}}-{{option.id}}'><span></span>{{option.txt}}</label>
                    <span ng-if='option.id == 999' class="inputMargin">
                        <span ng-click='enableOther(option)' >
                        <input type='text' class="form-control textInputBox" ng-disabled='optOther.isDisabled' ng-required='optOther.isRequired' ng-model='optOther.txt'>
                    </span>
                    </span>
    < /div>

option.id 999适用于其他... 现在,如果我正常点击它,它工作得很好,但我想让用户点击其他文字!输入,所以我现在所做的是ng-click ='enableOther(option)'并在js中:

scope.enableOther = function(option) {
                        //console.log(option);
                         scope.choice.input = option;
                         scope.otherEnable();
                };

问题是它启用了其他文本,但输入无线电!按钮没有标记...... 我不明白为什么..

0 个答案:

没有答案
相关问题