【问题标题】:Showing errors in modals在模态中显示错误
【发布时间】:2012-06-05 07:02:57
【问题描述】:

我正在使用 Twitter Bootstrap 中的模式进行弹出式登录和注册。所以我想做,当有人输入错误的输入时,它不应该重定向到另一个页面,而是显示这个有错误的登录模式。

所以我有这个弹出登录的代码:

<a class="btn" data-toggle="modal" href="#login"">Login</a>

<div class="modal hide" id="login">   
 <%= render :template => "devise/sessions/new" %>
</div>

有人可以建议我怎么做吗?

【问题讨论】:

    标签: authentication twitter-bootstrap modal-dialog


    【解决方案1】:

    当登录凭据与模式 JavaScript 方法错误时,您应该激活模式:$("div.modal").modal(options); 其中 options 是这样的 JSON 对象

    
        {
            backdrop: true,      // Includes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.
            keyboard: true,      // Closes the modal when escape key is pressed
            show:     true       // Shows the modal when initialized.
        }
    

    【讨论】:

      猜你喜欢
      • 2020-07-23
      • 1970-01-01
      • 1970-01-01
      • 2019-05-05
      • 1970-01-01
      • 2020-09-14
      • 2022-11-12
      • 2015-08-01
      • 2020-01-20
      相关资源
      最近更新 更多