For someone else's form, how can I add a click event to its input submit type form button and prevent its default form from being submitted?
怪我咯2017-05-19 10:36:03
You can replace input submit with button and bind click e.preventDefault();
伊谢尔伦2017-05-19 10:36:03
Hello, you can override the onclick event of the submit button and return false;
after the meeting.
The following is part of the code, for reference only:
document.getElementById('submitButton').onclick = function() {
// your code here...
return false;
};
淡淡烟草味2017-05-19 10:36:03
Not validating form when submitting it :
<form novalidate="novalidate">
阿神2017-05-19 10:36:03
You can return false when on submit, and then the submit button can be onclik