How to prevent form from being submitted?

后端 未结 10 2343
挽巷
挽巷 2020-11-21 07:06

I have a form that has a submit button in it somewhere.

However, I would like to somehow \'catch\' the submit event and prevent it from occurring.

Is there s

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-21 07:44

    Here my answer :

    ...

    I add event.preventDefault(); on onsubmit and it works.

提交回复
热议问题