PC Review


Reply
Thread Tools Rate Thread

Default button mapped to the Enter key would be "Submit"

 
 
=?Utf-8?B?U2FuamVlYiBTYXJhbmdp?=
Guest
Posts: n/a
 
      6th Feb 2004
I have got a couple of Serverside Button Controls in a page. Each button performs different actions, e.g. Button1 performs Submit, Button2 performs Cancel etc. Now, I want the default button mapped to the Enter key would be "Submit". I know a couple ways to achive this functionality using html buttons. But, how to achieve this functionality with Serverside buttons? Any idea

Thanks in advance

 
Reply With Quote
 
 
 
 
Simon Storr
Guest
Posts: n/a
 
      6th Feb 2004
you could make the button focus on page load with javascript -
Button1.focus();

You could also set the TabIndex to 1 to make it the 1st control in the tab
order.

Simon

"Sanjeeb Sarangi" <(E-Mail Removed)> wrote in message
news:84C9112C-7EB3-4844-8AF6-(E-Mail Removed)...
> I have got a couple of Serverside Button Controls in a page. Each button

performs different actions, e.g. Button1 performs Submit, Button2 performs
Cancel etc. Now, I want the default button mapped to the Enter key would be
"Submit". I know a couple ways to achive this functionality using html
buttons. But, how to achieve this functionality with Serverside buttons? Any
idea?
>
> Thanks in advance.
>



 
Reply With Quote
 
Ian Oldbury
Guest
Posts: n/a
 
      6th Feb 2004
hi Sanjeeb,

If you place this line of code within

Page.RegisterHiddenField("__EVENTTARGET", "btnLogin")

where btnLogin is the name of control that you wish to fire by default.

Hope this helps

ian

"Sanjeeb Sarangi" <(E-Mail Removed)> wrote in message
news:84C9112C-7EB3-4844-8AF6-(E-Mail Removed)...
> I have got a couple of Serverside Button Controls in a page. Each button

performs different actions, e.g. Button1 performs Submit, Button2 performs
Cancel etc. Now, I want the default button mapped to the Enter key would be
"Submit". I know a couple ways to achive this functionality using html
buttons. But, how to achieve this functionality with Serverside buttons? Any
idea?
>
> Thanks in advance.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
change button type from "submit" to "button" Tony WONG Microsoft ASP .NET 2 22nd Apr 2010 07:45 AM
How can I link a "Submit" button to a "Thank you" page? =?Utf-8?B?RnJpZW5kbHkgTmVpZ2hib3I=?= Microsoft Frontpage 2 24th Oct 2005 03:33 PM
Set a button as default "enter" input. Jensen bredal Microsoft ASP .NET 3 21st Sep 2005 01:52 PM
Form Submit button--How to remove default Enter? B Tuohy Microsoft Frontpage 2 12th Mar 2005 06:40 AM
Key press "Enter" does not submit the form Andrea Williams Microsoft ASP .NET 1 24th May 2004 10:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:54 AM.