How we disable form submit when enter key is pressed??
You have a form where in an input text box. If you enter a string and press enter then time your form will be submitting.
If you only want to disable the Enter key to submit the form, then you need to let its keypress event handler return false when the keycode matches 13.
Preventing form submission when Enter key is pressed will solved by following trick.
<form onkeypress="return event.keyCode != 13;">
I hope it will work for you. 🙂
If you have any queries, please do not hesitate to contact me at Jainish Senjaliya