IE 对于以下两种情况的处理是不一样的:

  • 页面上只有一个 text box,当输入焦点在这个 text box 中时按下 Enter 键
  • 页面上包含多个 text box,当输入焦点在这个 text box 中时按下 Enter 键

对于上述情况,在 MSDN 中只用了两句话进行描述:
If the form includes only one text box and the user presses ENTER, the onsubmit event fires. If the form has an INPUT type=submit element, it will appear as a button with a dark border, which indicates the user can press ENTER to submit the form.
注:来自 http://msdn.microsoft.com/en-us/library/ms535249(VS.85).aspx

CSDN 上有相关的讨论,具体见 http://topic.csdn.net/t/20061128/14/5191186.html
个人感觉比较简便的解决方法是当页面上只有一个 text box时,再加一个<input   style="display:none">

相关文章:

  • 2022-01-18
  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2021-07-06
  • 2021-12-15
  • 2021-06-10
  • 2021-10-08
  • 2021-10-15
  • 2021-11-24
  • 2021-10-05
相关资源
相似解决方案