Javascript override form onsubmit event not working

前端 未结 4 1320
粉色の甜心
粉色の甜心 2021-01-12 20:20

I am overriding a form submit event like this:

form.onsubmit = function(event) {
  event.preventDefault();

But when I call submit on the fo

4条回答
  •  北海茫月
    2021-01-12 20:43

    Try with this one

    form.submit = function() {
      //event.preventDefault();     No need of this call
      //do your processing here
    }
    

提交回复
热议问题