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

后端 未结 14 1997
耶瑟儿~
耶瑟儿~ 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:37

    In fact, because you write submitmyform();return false only submitmyform is evaluated.

    In the case of two commands, you will have to put them between braces like this

    {submitmyform();return false;}
    

    so that both are evaluated.

提交回复
热议问题