In IE8 enter key in a form does not work

后端 未结 14 2357
失恋的感觉
失恋的感觉 2020-12-17 08:55

I have a problem that in IE8 the enter does not work to submit a form. I have generated a test page to expose this problem. It seems that displaying the form in the on

相关标签:
14条回答
  • 2020-12-17 09:47

    I believe Yasin has got the point. I just had the same problem: multiple text fields within a form whose visibility is "hidden". My workaround (to prevent the form from flashing) is to set the form opacity to 0 in the css, and then customise its style settings with jQuery on document ready.

    I believe this is not something to fix with JS.

    0 讨论(0)
  • 2020-12-17 09:48

    I tried it in IE8 and it works for me. You have to make sure that part of the form has focus though.

    Javascript has a focus function that you can use to set the focus if that's what you need.

    var textbox = document.getElementById("whatever name input box's id will be");
    if(textbox) textbox.focus();
    
    0 讨论(0)
提交回复
热议问题