Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Submitting the form correctly using the enter key

Reply
Thread Tools

Submitting the form correctly using the enter key

 
 
thechaosengine
Guest
Posts: n/a
 
      01-10-2005
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


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-10-2005
Enter 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%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      01-10-2005
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/darr...3/03/8374.aspx

--

Riki


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing the Enter key from submitting a form donpro Javascript 2 11-09-2007 07:33 PM
C# .NET stop carriage return/enter key submitting the form Veronica Bourke ASP .Net Web Controls 3 02-16-2005 06:06 PM
Enter Key H*ll, control enter key submit button BrianDH ASP .Net Web Controls 3 01-12-2005 08:29 PM
Replace Tab Key to Return Key (Enter Key) from Web Forms? M P ASP General 1 08-06-2004 08:32 AM
stop enter key from submitting a form Phil HTML 2 09-13-2003 05:36 AM



Advertisments