473,320 Members | 1,848 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.

Setting default button

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

Now I am entering the name, entering the surname and while I am on the
surname I press Enter and the Reset button is being pressed.

How can I change it so that by default the Submit button is pressed
instead.

Can someone help me out please.
Thanks in Advance
Nov 19 '05 #1
3 1832
Enter activates the first submit button in the layout. See details at
http://www.allasp.net/enterkey.aspx

Eliyahu

"Xarky" <be*********@yahoo.com> wrote in message
news:bc*************************@posting.google.co m...
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

Now I am entering the name, entering the surname and while I am on the
surname I press Enter and the Reset button is being pressed.

How can I change it so that by default the Submit button is pressed
instead.

Can someone help me out please.
Thanks in Advance

Nov 19 '05 #2
It isn't the label that defines a button. It's the type. Example:

<input type="submit" value="Reset">

Makes a Submit button with the label "Reset".

<input type="reset" value="Submit">

Makes a Reset button with the label "Submit".

<input type="button" value="Click Me">

Makes a normal button that has a label "Click Me" and does nothing when
clicked, as it has no "onclick" event handler.

Now, a browser will, by default submit a form when you press the ENTER key.
So, it all depends on what type of buttons you're using, which one gets the
event handler.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Xarky" <be*********@yahoo.com> wrote in message
news:bc*************************@posting.google.co m...
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

Now I am entering the name, entering the surname and while I am on the
surname I press Enter and the Reset button is being pressed.

How can I change it so that by default the Submit button is pressed
instead.

Can someone help me out please.
Thanks in Advance

Nov 19 '05 #3
You could use this free control to solve the problem.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here are a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Xarky" <be*********@yahoo.com> wrote in message
news:bc*************************@posting.google.co m...
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

Now I am entering the name, entering the surname and while I am on the
surname I press Enter and the Reset button is being pressed.

How can I change it so that by default the Submit button is pressed
instead.

Can someone help me out please.
Thanks in Advance

Nov 19 '05 #4

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

Similar topics

2
by: AA Arens | last post by:
When I place a record serch utility (vos the button placement wizzrd), I discovered that the Match setting is "Whole Field" by default. How to make "Any Part Of Field" default?
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
4
by: Jeff Cope | last post by:
I'd like to have a text box on my webform and a button beside that will set the current date in the text box when the button is clicked. Is there a way to do this without doing a postback? ...
3
by: Brian Henry | last post by:
Hi, I have a bunch of forms in a DLL that I call from my main application. The one form is a login form, and I have the tab order set in the order I want it (password box first, then ok button...
3
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the...
1
by: andyrich_1 | last post by:
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...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
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...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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.