Saturday, March 31, 2012

Submitting the form correctly using the enter key

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 RegardsEnter activates the first submit button in the layout. See details at
http://www.allasp.net/enterkey.aspx
Can you place the logout button after the submit one?
Eliyahu
"thechaosengine" <sh856531@.microsofts_free_email_service.com> wrote in
message news:O5N%23amv9EHA.2996@.TK2MSFTNGP10.phx.gbl...
> 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
>
thechaosengine wrote:
> 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/dar...03/03/8374.aspx
Riki

0 comments:

Post a Comment