Prevent the form form from submitting automatically

Method 1:
Add in the form tag οnsubmit="return false;", for example

<form class="" action="" onsubmit="return false;"></form>

Method 2:
Add the οnkeydοwn attribute to the input tag that you want to block the carriage return submission, for example

<input onkeydown="if(event.keyCode == 13){return false;}" />

Method 3:
Add a hidden input tag to the form tag. Hidden cannot be used, but display:none should be used, for example

<form class="" action="" onsubmit="return false;">
	 <input type="text" style="display: none;" />
	 <input type="text" /> // 欲进行其他回车操作的input标签
</form>

Guess you like

Origin blog.csdn.net/m0_38038767/article/details/100632172