submit event does not fire if submit initiated programmatically

后端 未结 2 1114
你的背包
你的背包 2020-11-30 12:37

I have a HTML form with button:

<
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 13:26

    Browsers don't fire the form's onsubmit handler when you manually call form.submit().

    jQuery also mimicks used to mimick that (see this "wontfix" "bug" report).

    See also:

    • Should jQuery's $(form).submit(); not trigger onSubmit within the form tag?
    • JQuery: on submit doesn't work

提交回复
热议问题