onsubmit=“return false” has no effect on Internet Explorer 7/8 (form is still submitted)

后端 未结 14 2043
耶瑟儿~
耶瑟儿~ 2020-12-11 04:03

I have a form that will be submitted by javascript code triggered in \"onsubmit\" of the tag. Works fine on all browsers - but not on IE7/IE8.

What can I do?

<
14条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 04:38

    If you want IE to be standards compliant, you'll have to tell it which standard it's supposed to comply with in a declaration.

    Without one it's going to be endless frustration to get it to do what you want. With one, most of the frustration goes away because it starts working as every other browser.

提交回复
热议问题