【问题标题】:Does autocomplete=off work well with bootstrap as well?autocomplete=off 是否也适用于引导程序?
【发布时间】:2016-06-30 03:43:06
【问题描述】:

HTML 代码:

 <div class="col-md-2 col-md-offset-2 gallery-item">
                <div style="padding-top: 50%; float:right;">
                    <label class="btn btn-info" for="notASign">
                        <input type="radio" name="radio-button-group" id="radioid" autocomplete="off" >Radiobuttontext
                    </label>
                </div>
            </div>

在页面刷新时对我不起作用。单选按钮保持选中状态。

【问题讨论】:

    标签: jquery twitter-bootstrap radio-button


    【解决方案1】:

    单选按钮通常用于从组中选择单个项目。因为您的单选按钮只是一组中的一个,所以默认选中它。在这里使用复选框可能更有意义:

    <div class="checkbox">
      <label>
        <input type="checkbox"> Check me out
      </label>
    </div>
    

    默认不勾选。此外,autocomplete=off 旨在用于表单字段,并禁止浏览器记住用户之前输入的内容。它不会影响单选按钮或复选框:https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-03
      • 1970-01-01
      • 1970-01-01
      • 2013-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-04
      相关资源
      最近更新 更多