Home > Article > Backend Development > The button (type=submit) element in the form element will execute the onclick event when the enter key is pressed. How to disable the action?
The button (type=submit) element in the form element will execute the onclick event when the enter key is pressed. Then the action will also be executed. What is the order?
The button (type=submit) element in the form element will execute the onclick event when the enter key is pressed. Then the action will also be executed. What is the order?
onsubmit="javascript:return false"
should execute onclick first and then onsubmit
<code>// 禁止表单提交 <form onsubmit="return false;"></form></code>