【问题标题】:Form tag removing automatically from Bootstrap modal从 Bootstrap 模式中自动删除表单标签
【发布时间】:2015-06-11 13:08:40
【问题描述】:

在默认的 magento 1.9 版本中,我遇到了模态弹出的问题。

它工作正常,但 form 标记被自动删除。当我查看页面源代码时,form 标记就在那里。我不知道我做错了什么。

<a data-toggle="modal" href="#myModal" class="btn btn-primary">Launch modal</a>
<div class="modal" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body">
        <form id="modalForm" name="modalForm" action="/test" method="post">
          <input type="text" name="text" />
        </form>
        Content for the dialog / modal goes here.
      </div>
      <div class="modal-footer">
        <a href="#" data-dismiss="modal" class="btn">Close</a>
        <a href="#" class="btn btn-primary">Save changes</a>
      </div>
    </div>
  </div>
</div>

Fiddle demo

有什么帮助吗?

【问题讨论】:

  • 也许显示一些代码会帮助我们帮助你
  • 请检查,我已经更新了我的问题。
  • 添加了小提琴演示。我不明白这个问题。
  • 在 magento 产品页面弹出窗口已打开,但 from 标签未显示。

标签: html twitter-bootstrap magento-1.9


【解决方案1】:

我今天遇到了这个确切的问题(尽管我使用的是 Spree 而不是 Magento)。我的错误是将引导模式 html 放在 现有的表单元素中。

Chrome 会自动删除现有 form 元素中的 form 标记。 See question here.

将模态窗口移动到正文标签的底部可能会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-01
    • 2014-12-01
    • 2016-11-23
    • 2018-08-13
    • 2019-01-06
    • 1970-01-01
    • 2013-02-27
    相关资源
    最近更新 更多