Submitting the form correctly using the enter key

T

thechaosengine

Hi all,

Simple problem:

I have a simple form and a submit and cancel image button underneath.

I also have a logout image button at the top of the page. This button is
rendered from a user control that is seperate from the form page itself.

At the moment if I press enter when inside a textbox the log out button is
activated. How can I make sure that the submit button is activated when the
user presses enter?

Many thanks all

Kind Regards
 
R

Riki

thechaosengine said:
Hi all,

Simple problem:

I have a simple form and a submit and cancel image button underneath.

I also have a logout image button at the top of the page. This button
is rendered from a user control that is seperate from the form page
itself.

At the moment if I press enter when inside a textbox the log out
button is activated. How can I make sure that the submit button is
activated when the user presses enter?

Many thanks all

Kind Regards

You can capture the Enter key with JavaScript
to get the behavior you want:
http://dotnetjunkies.com/WebLog/darrell.norton/archive/2004/03/03/8374.aspx
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top