473,848 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setting default enter button

I have a simple form that has two submit buttons on it.
The problem I have is that I want one button to be the default button
when the user is filling out one section of the form and another button
to be the default when filling out a different art of the form.

I can't seem to find a way of stopping the first button on the form
begin selected.

I know there is a way to do this in ASP.NET 2.0 but I can't seem to
find one in ASP.NET 1.0

Thanks,
Andy

May 6 '06 #1
1 2120
In ASP.NET 1.x, you can set the default button, but it requires a trip to
the server.

Page.RegisterHi ddenField("__EV ENTTARGET", "MyButton") ;

If you are basing decisions on what is going on while the form is being
filled out, you need to use JavaScript. One way is to handle the button
press event and adjust the button pushed based on what button is pushed
(enter, for example). Another is to set the Event Target. I believe this is
document.eventT arget = objToPush;.

--
Gregory A. Beamer

*************** *************** *************** ****
Think Outside the Box!
*************** *************** *************** ****
<an********@hot mail.com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
I have a simple form that has two submit buttons on it.
The problem I have is that I want one button to be the default button
when the user is filling out one section of the form and another button
to be the default when filling out a different art of the form.

I can't seem to find a way of stopping the first button on the form
begin selected.

I know there is a way to do this in ASP.NET 2.0 but I can't seem to
find one in ASP.NET 1.0

Thanks,
Andy

May 6 '06 #2

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

Similar topics

1
2597
by: Jason Charalambides | last post by:
Could someone please help me on how I can set the "Enter" key to activate one specific task in my form? I have my program arranged in a manner similar to the "Display Properties" of the Windows environment, i.e. the window that comes up when we right click on our desktop and chose "properties". On every "page" or whatever we call what appears when we click on a tab, I always have a "calculate" button. I want that button to be the...
1
6400
by: Billy Jacobs | last post by:
Is there a way to make a button on a web form the default button so that when the user hits the enter button the code for that button executes? I have a web page Login.aspx where I have only 1 button on the form. When the user hits enter the button is clicked. I have a second page mycsepp.aspx which has an asp button and a link button. When I hit enter neither of the button click events are triggered. If I tab to one of them and
1
1417
by: MSDousti | last post by:
Hello I want to put a Spinner and set an Edit to its Buddy. I have some problems: 1- I want the spinner to add/subtract 0.01 to/from the number shown in Edit, but it just works with integers(0,1,2,3,etc.) 2-When I press ENTER on the Edit box, it terminates my program and returns to my code (without any error)
2
1598
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 processed - wrong. so, how to make a button default (when one presses ENTER then it's processed onClick event)? thanks, bj
3
1124
by: Richard Roche | last post by:
What are the ways to set default (activiated on enter) status for buttons? i've tried: TabIndex and Page.RegisterHiddenField("__EVENTTARGET", "cmdWhatever") but the first button seems to be default always. I must be missing something.
2
1829
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() from within the main page. My Login UserControl has a "Login" button and I want that to become the default button when the user presses .
3
1860
by: Xarky | last post by:
Hi, I have a page with 2 textboxes(Name and Surname) and two buttons(Submit and Reset). Now I have set the tab for them 1 Name 2 Surname 3 Submit 4 Reset
15
12561
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 property. Where is it? Or mabye change the other thing,No?Thanks ! Simon
0
1382
by: Glenn | last post by:
I currently have a page that contains a logon control and a Wizard control. I am having an issue when the user hits the "Enter" key, the user gets logged off. This is because the logon control appears at the top of the page and the browser defines the first submit button that appears on the page as the "default" button. On other pages I have resolved this issue by wrapping my input controls in an ASP Panel and setting the panel's...
0
9893
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10722
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10348
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9500
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.