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?
光阴似箭催人老,日月如移越少年。
You can replace input submit with button and bind click e.preventDefault();
e.preventDefault();
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:
return false;
document.getElementById('submitButton').onclick = function() { // your code here... return false; };
Change the type of input to button, and then bind click.
Not validating form when submitting it :
<form novalidate="novalidate">
You can return false when on submit, and then the submit button can be onclik
You can replace input submit with button and bind click
e.preventDefault();
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:
Change the type of input to button, and then bind click.
Not validating form when submitting it :
You can return false when on submit, and then the submit button can be onclik