473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Default button - pressing Enter

I have a form with 2 or more buttons. How do I control which one will
fire when I press the Enter key? In traditional ASP, I could create 2
or more forms, each with their own Submit buttons. Since there is only
one form, how do I control which of the submit buttons will fire?
Nov 18 '05 #1
3 1436
Hi Dan,

these URLs will help.

http://www.developer.com/net/asp/article.php/1594521
http://groups.google.com/groups?hl=e...readm=u%24MfvC
nrBHA.2072%40tkmsftngp07&rnum=2&prev=/groups%3Fq%3Ddefault%2Bbutton%2BASP%2B
..NET%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

hope they help.

--
Cheers!
Rajiv. R
Rajspace.Org

"Dan Brussee" <db******@nc.rr.com> wrote in message
news:2g********************************@4ax.com...
I have a form with 2 or more buttons. How do I control which one will
fire when I press the Enter key? In traditional ASP, I could create 2
or more forms, each with their own Submit buttons. Since there is only
one form, how do I control which of the submit buttons will fire?

Nov 18 '05 #2
Dan Brussee <db******@nc.rr.com> wrote in
news:2g********************************@4ax.com:
I have a form with 2 or more buttons. How do I control which one will
fire when I press the Enter key? In traditional ASP, I could create 2
or more forms, each with their own Submit buttons. Since there is only
one form, how do I control which of the submit buttons will fire?


Use JS and capture the enter key. You can then tell it to do what you want.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Nov 18 '05 #3
Max
Page.RegisterHiddenField("__EVENTTARGET", "bSearch")

in the Page_Load sub works

If this is in a user control, I've learned that you need to change the
"bSearch" to the NAME of the button as it is rendered on the page. So since
my button is actually inside a user control, I had to do:

Page.RegisterHiddenField("__EVENTTARGET", "WucPager1:bSearch")

-Max
"Dan Brussee" <db******@nc.rr.com> wrote
I have a form with 2 or more buttons. How do I control which one will
fire when I press the Enter key? In traditional ASP, I could create 2
or more forms, each with their own Submit buttons. Since there is only
one form, how do I control which of the submit buttons will fire?


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bratislav Jevtic | last post by:
hi, how to make some push button default on the form? for instance, I've got 2 buttons (Submit, Cancel). submit is on the left, cancel on the right side. on enter key pressed, cancel button is...
2
by: Ben Fidge | last post by:
Hi I'm writing a web application where the entire site is driven through a single page, and content is dynamically loaded using Web UserControls. This is achieved by using Page.LoadControl()...
1
by: George Homorozeanu | last post by:
Hi, I have an ASP.Net Page with some control on it (buttons, textboxes, calender, etc). When I'm changing the text in the textbox I want to run some code and change the date of the calendar. The...
12
by: SJ | last post by:
Hope someone can help me out there I'm struggling with a particular problem... I have a form with many tab pages. On one tab page I've got a button which when clicked with a mouse adds items...
15
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this...
1
by: Joey | last post by:
I have an asp.net 1.1/C# web form with a text box server control and one button server control. Users can type in text to search and then click the button to start the search. I want them to be...
6
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I have an application that is designed for using with a bar code scanner. I want the user to know that the scan was complete and the data was entered, so I am playing a system sound after data...
6
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.