IE 5+ default form submit on Enter Key Press

W

WJ

I have a form that has one textbox control and one textarea.

Through experimentation, it occurred to me that, when there is
only one textbox, pressing the ENTER key submits the
form. If I have two or more, it won't do this.

Is there a way in HTML (or other mean, such as script)
to disable this?

I have scripts that run on the keypress
events of certain buttons. Having to roll the functionality
into an onSubmit() event of the form is really going to be
a pain.
 
A

Adrienne

I have a form that has one textbox control and one textarea.

Through experimentation, it occurred to me that, when there is
only one textbox, pressing the ENTER key submits the
form. If I have two or more, it won't do this.

Is there a way in HTML (or other mean, such as script)
to disable this?

I have scripts that run on the keypress
events of certain buttons. Having to roll the functionality
into an onSubmit() event of the form is really going to be
a pain.

Validate server side. If there is data missing, then return them to the
calling page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top