当选项按钮单击文本字段文本应该被删除而不是禁用

时间:2015-08-24 12:13:38

标签: angularjs twitter-bootstrap radio-button angularjs-ng-repeat collapsable

我有this Plnkr。启用提供的脚本选项后,应删除文本中的文本框。

  • 点击Plnkr
  • 中的加号按钮
  • 转到单选按钮内的折叠面板。单击提供的脚本按钮。

相关代码:

<table class="range-table" width="100%">
    <tr>
      <tr ng-repeat="contact in contacts track by $index">
        <td>
          <accordion>
            <accordion-group is-open="status.open" ng-repeat="group in groups">
              <accordion-heading>
                <span ng-click="opened(group, $index)">{{group.title}}{{contact}}</span><i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': status.open, 'glyphicon-chevron-right': !status.open}"></i>
              </accordion-heading>
              <div> {{group.content}}
                <label>
                  <input type="radio" ng-model="form.Program" value="custom" required /> Customize</label>
                <label>
                  <input type="radio" ng-model="form.Program " value="other" required ng-click="form.OtherProgram = null" /> Provide Script</label>
                <input type="text" ng-model="form.OtherProgram" ng-disabled="form.Program != 'other'" name="Program_Other" ng-required="form.Program != 'other'" />
              </div>
            </accordion-group>
          </accordion>
        </td>
      </tr>
</table>

1 个答案:

答案 0 :(得分:0)

只需使用builder.set_translation_domain("pygibank")ng-click文字输入更改为ng-model

null

编辑:

如果我在此处理解的是更新后的答案,请先使用自定义变量<input type="radio" ng-model="form.Program " value="other" required ng-click="form.OtherProgram = null" /> 设置为false,然后使用disableOption进行播放,您就完成了:

ng-click