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

Default Buttonwhen enter is used?

Hi,

when I create a form in ASP.NET, how do I define the default Button which is
send with the form as being clicked on, when I press the enter.

I have three buttons,
Update, Delete and Cancel

Furthermore there are a number buttons defined as a menu.

When I press enter in the form, I want to have the Update button to be sent
with the Form, but now, the first menu button is being sent with the form as
being clicked.

Thanks,
Ben
Nov 18 '05 #1
3 1115
I never found away around that....technically.

What I do is make Update a button and Cancel and Delete LinkButtons. That
way enter makes the update occur and the user will have to click the link
button to submit it.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email sa***@bangproject.com for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
Nov 18 '05 #2
When I first looked at this I recalled that it is possible to set a default
Enter button for a form.
Too bad what I recalled was for Windows forms, not Web forms! <g>

A Google search should reveal some of the issues as to why IE operates the
way it does with respect to submitting forms on Enter.

I was looking for a way to turn off the behavior.

I found a nice script for killing the Enter key and embedded it in my Base
page as a Property so I can automatically disable Enter on all pages except
those that I want it available on.
--
Joe Fallon

"Eric Marvets" <er***@bangproject.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
I never found away around that....technically.

What I do is make Update a button and Cancel and Delete LinkButtons. That
way enter makes the update occur and the user will have to click the link
button to submit it.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email sa***@bangproject.com for Information on Our Architecture and
Mentoring Services

</shameless self promotion>

Nov 18 '05 #3
Check out this article,
http://www.allasp.net/enterkey.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
Hi,

when I create a form in ASP.NET, how do I define the default Button which is send with the form as being clicked on, when I press the enter.

I have three buttons,
Update, Delete and Cancel

Furthermore there are a number buttons defined as a menu.

When I press enter in the form, I want to have the Update button to be sent with the Form, but now, the first menu button is being sent with the form as being clicked.

Thanks,
Ben

Nov 18 '05 #4

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

Similar topics

3
by: Ian D | last post by:
Firstly apologies for the convoluted question. I found this problem whilst building a larger database. I've distilled it down to as small as possible and can send a 200k example to anyone who has...
12
by: Phoe6 | last post by:
The Program Fragment is this: int choice; /* Users Input Command */ .. .. .. printf("Enter a command: "); fflush(stdin); choice = getc(stdin); printf("\n");
5
by: Chuck Bowling | last post by:
Maybe I'm doing something wrong or just don't understand the concept, but i'm having a problem with default properties. My impression of how a default property should act is this; MyClass c =...
7
by: Derrick | last post by:
Didn't there used to be some property where you could set a button to be the "default" so that if a user pressed enter with any control in focus, the button would still get the click event? Some...
21
by: planetthoughtful | last post by:
Hi All, As always, my posts come with a 'Warning: Newbie lies ahead!' disclaimer... I'm wondering if it's possible, using raw_input(), to provide a 'default' value with the prompt? I would...
5
by: HandersonVA | last post by:
should I set to "0" as a default value on a quantity and a price field or set to "null"? if a user enter nothing on the quantity or price field on a web browser, should I treat it as null or "0"?...
4
by: helenwheelss | last post by:
Access 2003, using a bound form. I'm seeing rather annoying behaviour when editing data in a control with a default value. It only happens when the form is on a new record. A specific...
4
by: TinaF | last post by:
I want to set a default value in a table called "Quotes" for a field called "Source." The "Source" field uses a lookup table called "Source" which looks like this: Sourceabbrev Sourcename...
3
beacon
by: beacon | last post by:
Hi, I'm doing a homework assignment, but I have done most of the work and am only looking for some tutoring to get past this small portion of the program I have been tasked to write. The...
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...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.