Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmit the button name by hitting the enter key on IE6
    primarykey
    data
    text
    <p>I have a problem on IE6 only.</p> <p>I have a page with several forms, each contains a textbox and a submit button. As I'm using .NET MVC, I need the name of the submit button to execute the correct Action. When I'm hitting 'Enter' key, I have the same behaviour as a clicked action on Firefox or Chrome (Field and ButtonName is sent), but not in IE6, where I have only the field that sent.</p> <p>So how to send the name of the button when I'm hitting 'Enter' key on IE6 ?</p> <p>tl/dr : I need to send in POST this </p> <pre><code>Field=foo&amp;Search= </code></pre> <p>by clicking the 'Enter' key on IE6 and not only</p> <pre><code>Field=foo </code></pre> <p>Chrome and Firefox works well by clicking or hitting 'Enter'</p> <p>Thanks for helping :)</p> <p>[EDIT] Add an example:</p> <p>Source code </p> <pre><code> &lt;!-- gestion type operation --&gt; &lt;fieldset&gt; &lt;legend&gt;Interface de gestion des Types d'Opérations&lt;/legend&gt; &lt;% Html.BeginForm("TypeOperation", "Administration", FormMethod.Post); %&gt; &lt;%= Html.EditorFor(m =&gt; m.TypeOperationField)%&gt; &lt;input type="submit" id="RechercheTypeOperation" name="RechercheTypeOperation" value="" class="loupe" /&gt; &lt;% Html.RenderPartial("ListeTypeOperation", Model); %&gt; &lt;% Html.EndForm(); %&gt; &lt;/fieldset&gt; &lt;!-- gestion type operation --&gt; </code></pre> <p>It is pretty simple, this form struct is repeated each time I need a search textbox + submit button in page. Forms are well opened and closed when the code is generated.</p> <p>Generated Code</p> <pre><code> &lt;!-- gestion type operation --&gt; &lt;fieldset&gt; &lt;legend&gt;Interface de gestion des Types d'Op&amp;#233;rations&lt;/legend&gt; &lt;form action="/Administration/TypeOperation" id="form3" method="post"&gt; &lt;input class="text-box single-line" id="TypeOperationField" name="TypeOperationField" type="text" value="" /&gt; &lt;input type="submit" id="RechercheTypeOperation" name="RechercheTypeOperation" value="" class="loupe" /&gt; &lt;div&gt; &lt;table class="grid"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt;// &lt;![CDATA[ if (!window.mvcClientValidationMetadata) { window.mvcClientValidationMetadata = []; } window.mvcClientValidationMetadata.push({"Fields":[],"FormId":"form3","ReplaceValidationSummary":false}); //]]&gt; &lt;/script&gt; &lt;/fieldset&gt; &lt;!-- gestion type operation --&gt; </code></pre> <p>[EDIT 2] I have add this line inside my form </p> <pre><code>&lt;!--[if IE]&gt;&lt;input type="text" style="display: none;" name="RechercheTypeOperation" value="" disabled="disabled" size="1" /&gt;&lt;![endif]--&gt; </code></pre> <p>And it's working.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload