Jquery - How to trigger $('#myForm').submit(function()

后端 未结 6 1765
暗喜
暗喜 2020-12-30 02:56

how can i trigger this function without using the form submit?

$(\'#myForm\').submit(function()
{ ....
6条回答
  •  长发绾君心
    2020-12-30 03:44

    return false;
    

    adding this to function will stop the form submitting.

    Or if you want to call function on a different event put the function in an appropriate event handler (a non-submit button's click?)

提交回复
热议问题