You are here
Home > Javascript > Prevent Form Submission on Pressing Enter on Specific Field of Form

Prevent Form Submission on Pressing Enter on Specific Field of Form

Hello Friends, Today I am going to share how we can prevent form submission on pressing enter on specific field of a form. Actually when we press enter inĀ fields of a form (form tag in html), it triggers form submission by default, but sometime we don’t want form to be submitted on pressing enter on some specific fields, actually recently I was developing a project in which I faced same situation where some fields are just used for generating some rows in a table, So I thought to share it with everyone. So here is the code

Output

preventing-form-submission.html

Thanks for visiting, please do share if you like it

 

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top