form:remote =>是的,在IE中提交了两次

时间:2011-08-03 11:00:21

标签: ruby-on-rails ruby-on-rails-3 internet-explorer

我有一个表格标签,如下所示:

      <%= form_tag(new_invitations_invitations_path, :remote => true) do %>
        <%= hidden_field_tag(:provider, "yahoo") %>
        <dl>
          <dt><strong>Your email:</strong></dt>
          <dd><%= text_field_tag('email') %></dd>
        </dl>
        <dl>
          <dt><strong>Password:</strong></dt>
          <dd><%= password_field_tag('pass') %></dd>
        </dl>
        <dl>
          <dt>&nbsp;</dt>
          <dd><%= submit_tag "Import your address book", :disable_with => "Please wait..." %></dd>
        </dl>
      <% end %>

Above给出输出HTML如下:

<form accept-charset="UTF-8" action="/invitations/new_invitations" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="EC+HcCqnxadujZg8CMWHGT1blQ3KoIddlnR8teWaowQ=" /></div>
  <input id="provider" name="provider" type="hidden" value="yahoo" />
  <dl>
    <dt><strong>Your email:</strong></dt>
    <dd><input id="email" name="email" type="text" /></dd>
  </dl>
  <dl>
    <dt><strong>Password:</strong></dt>
    <dd><input id="pass" name="pass" type="password" /></dd>
  </dl>
  <dl>
    <dt>&nbsp;</dt>
    <dd><input data-disable-with="Please wait..." name="commit" type="submit" value="Import your address book" /></dd>
  </dl>

当我尝试通过按提交按钮在IE中提交上述表单时,表单将提交两次。问题是,一旦提交格式为JS是正确的。一旦它作为HTML提交是错误的。由于第二次提交,我得到406不可接受的错误。

任何线索?

1 个答案:

答案 0 :(得分:0)

事实证明,在我的应用程序中,我在Prototype和rails.js上有旧版本。升级解决了这个问题。