473,407 Members | 2,598 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,407 software developers and data experts.

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 2099
In ASP.NET 1.x, you can set the default button, but it requires a trip to
the server.

Page.RegisterHiddenField("__EVENTTARGET", "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.eventTarget = objToPush;.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
<an********@hotmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.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
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...
1
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...
1
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...
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...
3
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...
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()...
3
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
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.