【发布时间】:2011-11-26 12:40:44
【问题描述】:
我一直在处理的奇怪问题令人沮丧。我的一个编辑视图上的提交按钮在 Internet Explorer 中不起作用。这是一个非常标准的布局,使用 input type = submit(不是自定义的 button_to 或其他东西)。
- 该按钮在 Mac 和 Windows 上的 Safari、Chrome 和 Firefox 中都能正常工作。
- 编辑提交按钮在 IE 的其他页面上工作正常
- 使用nested_form_for,与:html => {:multipart => true}
提交按钮 "post_button")%>
是否有人遇到过提交按钮在 IE 中不起作用的问题?
== 更新 ==
更新了 jQuery 以确保它不是 nested_form 问题。我实际上认为在我添加嵌套表单之前链接可能无法正常工作。但是,它一直是多部分的形式。
查看
<head>
<%= stylesheet_link_tag 'profile' %>
<%= javascript_include_tag "jquery.min", "nested_form" %>
</head>
<%= nested_form_for(@profile, :html => {:multipart => true}) do |f| %>
<div class="content">
<div class="editprofilesub">
<div class="profile_title"> basic </div>
<table>
<tr>
<td class="profileformright">
<%= f.label :firstname, "First Name" %>
</td>
<td class="profileformleft">
<%= f.text_field :firstname, :class => "profilefield", :class=>"profilefield" %>
</td>
</tr>
<tr>
<td class="profileformright">
<%= f.label :lastname, "Last Name" %>
</td>
<td class="profileformleft">
<%= f.text_field :lastname, :class => "profilefield" %>
</td>
</tr>
<td class="profileformright">
<%= f.label :avatar, "User Image" %><br>
</td>
<td class="profileformleft">
<i>Please rotate images prior to uploading.</i> <br>
<%= f.file_field :avatar%>
</td>
</table>
<div class="profile_title"> location </div>
<table>
<tr>
<td class="profileformright">
<%= f.label :city %>
</td>
<td class="profileformleft">
<%= f.text_field :city, :class => "profilefield" %>
</td>
</tr>
</table>
<br>
<table>
<tr>
<td class="profileformright">
<%= f.label :state, "State" %>
</td>
<td class="profileformleft">
<%= f.select :state, Carmen.state_names(),{}, :class=> "state" %>
</tr>
</table>
<div class="profile_title"> about </div>
<table>
<tr>
<td class="profileformright">
<%= f.label :bio, "about" %>
</td>
<td class="profileformleft">
<%= f.text_area :bio, :rows => '5', :cols => '60', :class => "profilefield" %><br>
</td>
</tr>
<tr>
<td class="profileformright">
<%= f.label :dob, "Date of Birth" %>
</td>
<td class="profileformleft">
<%= f.date_select :dob,
{:start_year => Time.now.year,
:end_year => 1900,
:order => [:month, :day, :year]}%>
</td>
</tr>
</table>
</div>
<div class="right">
<%= f.submit("update", :class=>"post_button")%>
</div>
</div>
<%end%>
【问题讨论】:
-
嗨@sannankhalid,我添加了视图。谢谢您的帮助。关于可能导致 IE 出现问题的任何想法?
标签: ruby-on-rails-3 internet-explorer submit