Enter button does not submit form (IE ONLY) ASP.NET

后端 未结 9 918
夕颜
夕颜 2020-12-01 10:17

I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found th

9条回答
  •  执笔经年
    2020-12-01 10:30

    When using display:none, IE won't see the button and therefore won't be able to use it to submit the form. Instead, you could use z-index and absolute positioning to hide it under another element, e.g. with the style:

    position:absolute; bottom: -20px; left: -20px; z-index: -1;

    Now it'll still be there, usable by IE, but hidden beneath another element.

提交回复
热议问题