【问题标题】:Getting Check_Box to have a default value of nil with Bootstrap Switch使用 Bootstrap Switch 使 Check_Box 具有默认值 nil
【发布时间】:2015-09-04 19:24:08
【问题描述】:

http://www.bootstrap-switch.org/examples.html

我正在使用 Indeterminate 开关(使复选框保持在真假之间)。问题是开关默认为true。

基本上我希望该字段以 nil 形式提交,除非用户特别选择 true 或 false。

【问题讨论】:

    标签: jquery twitter-bootstrap bootstrap-switch


    【解决方案1】:

    杰克逊这就是你所需要的吗?
    切换的用途相同。

    <label>
          <input type="checkbox" checked> Checked
    </label>
    <br><br>
    <label>
          <input type="checkbox" unchecked> unChecked
    </label>   

    【讨论】:

    • 嗨@AngularJR - 我希望我的复选框以空值开始,直到它们被用户特别选中或取消选中。
    • 您好,对不起,我以为您只是想将其默认为 false。在此之前还有另一个答案是尝试data-indeterminate="true",但我认为这不会成功你想在这里。尝试搜索看看是否有答案。
    • 看看这个link here 还有here
    • 我最终只使用了带有提示的下拉菜单
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-08
    • 2021-11-01
    • 2012-03-17
    • 2016-05-15
    • 2018-01-20
    • 2020-07-20
    • 2018-01-04
    相关资源
    最近更新 更多