我只在IE6上有问题。通过点击IE6上的回车键提交按钮名称
我有一个页面有几种形式,每个包含一个文本框和一个提交按钮。当我使用.NET MVC时,我需要提交按钮的名称来执行正确的操作。当我点击'Enter'键时,我的行为与Firefox或Chrome上的点击操作(发送字段和按钮名称)相同,但不在IE6中,我只有发送的字段。
那么如何在IE6上点击'Enter'键时发送按钮的名称?
TL/DR: 我需要通过点击 'Enter' 键对IE6不仅
Field=foo
Chrome和Firefox通过点击或运行良好的POST这个
Field=foo&Search=
送打'输入'
感谢您的帮助:)
[编辑]添加一个例子:
的源代码
<!-- gestion type operation -->
<fieldset>
<legend>Interface de gestion des Types d'Opérations</legend>
<% Html.BeginForm("TypeOperation", "Administration", FormMethod.Post); %>
<%= Html.EditorFor(m => m.TypeOperationField)%>
<input type="submit" id="RechercheTypeOperation" name="RechercheTypeOperation" value=""
class="loupe" />
<% Html.RenderPartial("ListeTypeOperation", Model); %>
<% Html.EndForm(); %>
</fieldset>
<!-- gestion type operation -->
这是很简单的,这种形式的结构是,每次我需要一个搜索文本框+页面提交按钮重复。 生成代码时可以很好地打开和关闭表单。
生成的代码
<!-- gestion type operation -->
<fieldset>
<legend>Interface de gestion des Types d'Opérations</legend>
<form action="/Administration/TypeOperation" id="form3"
method="post">
<input class="text-box single-line" id="TypeOperationField"
name="TypeOperationField" type="text" value="" />
<input type="submit" id="RechercheTypeOperation"
name="RechercheTypeOperation" value="" class="loupe" />
<div>
<table class="grid">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>
</form>
<script type="text/javascript">//
<![CDATA[
if (!window.mvcClientValidationMetadata) { window.mvcClientValidationMetadata = []; }
window.mvcClientValidationMetadata.push({"Fields":[],"FormId":"form3","ReplaceValidationSummary":false});
//]]>
</script>
</fieldset>
<!-- gestion type operation -->
[编辑2]我有我的补充形式
<!--[if IE]><input type="text" style="display: none;" name="RechercheTypeOperation" value="" disabled="disabled" size="1" /><![endif]-->
,它的工作里面这条线。
请发布您的当前代码。 – Ant 2011-06-06 08:44:40
请停止支持IE6(除非你的老板要求你这样做,并且不想明白IE6需要尽快死掉) – ThiefMaster 2011-06-06 08:56:08
很明显,我没有选择使用IE6:'( – 2011-06-06 09:00:48