PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

how to change default ENTER key behaviour on a button/form

 
 
Flip
Guest
Posts: n/a
 
      17th Nov 2004
On my current form, when I hit the enter key in a texbox, the form appears
to resubmit itself, but it's not actually doing a submit (or so I think?).
I would like to have the enter button fire the logic I have for the button.
In other words, I would like to have a default button for the form, is this
making sense?

I thought I saw on Fritz Onion's MSDN webcasts there is a way to assign a
default button to a form/page, is this in fact possible?

I'm sorry, I'm new to c# (and loving it much more than jsps! :>). Thanks
for any help.


 
Reply With Quote
 
 
 
 
John M Deal
Guest
Posts: n/a
 
      17th Nov 2004
By default ASP.Net will press the first button in the tab order on the
page. If you want to change that behavior so that you get to pick the
button that is "clicked" when you hit enter then take a look at the
conversation here:

http://www.experts-exchange.com/Prog..._20944907.html

You should also be able to use that to determine how to modify
clientside behavior as well. Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Flip wrote:
> On my current form, when I hit the enter key in a texbox, the form appears
> to resubmit itself, but it's not actually doing a submit (or so I think?).
> I would like to have the enter button fire the logic I have for the button.
> In other words, I would like to have a default button for the form, is this
> making sense?
>
> I thought I saw on Fritz Onion's MSDN webcasts there is a way to assign a
> default button to a form/page, is this in fact possible?
>
> I'm sorry, I'm new to c# (and loving it much more than jsps! :>). Thanks
> for any help.
>
>

 
Reply With Quote
 
Saravana
Guest
Posts: n/a
 
      18th Nov 2004
Check out this article,
http://www.allasp.net/enterkey.aspx

--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com


"Flip" <[remove](E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> On my current form, when I hit the enter key in a texbox, the form appears
> to resubmit itself, but it's not actually doing a submit (or so I think?).
> I would like to have the enter button fire the logic I have for the

button.
> In other words, I would like to have a default button for the form, is

this
> making sense?
>
> I thought I saw on Fritz Onion's MSDN webcasts there is a way to assign a
> default button to a form/page, is this in fact possible?
>
> I'm sorry, I'm new to c# (and loving it much more than jsps! :>). Thanks
> for any help.
>
>



 
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 the default opening of a form to enter a new record Shazza Microsoft Access 2 26th Mar 2010 04:19 PM
Enter button behaviour Stapes Microsoft Access 1 20th Apr 2007 04:24 PM
Default Button Click On Enter KeyPress On Web Form Joey Microsoft ASP .NET 1 28th Feb 2007 04:12 PM
Default Button for Enter Key on Web Form Fred Nelson Microsoft C# .NET 4 6th Dec 2005 01:32 AM
Form Submit button--How to remove default Enter? B Tuohy Microsoft Frontpage 2 12th Mar 2005 06:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:38 AM.