Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Default Buttonwhen enter is used?

Reply
Thread Tools

Default Buttonwhen enter is used?

 
 
Ben de Vette
Guest
Posts: n/a
 
      05-23-2004
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


 
Reply With Quote
 
 
 
 
Eric Marvets
Guest
Posts: n/a
 
      05-23-2004
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 for Information on Our Architecture and
Mentoring Services

</shameless self promotion>


 
Reply With Quote
 
 
 
 
Joe Fallon
Guest
Posts: n/a
 
      05-24-2004
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" <> wrote in message
news:...
> 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 for Information on Our Architecture and
> Mentoring Services
>
> </shameless self promotion>
>
>



 
Reply With Quote
 
Saravana [MVP]
Guest
Posts: n/a
 
      05-24-2004
Check out this article,
http://www.allasp.net/enterkey.aspx

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



"Ben de Vette" <> wrote in message
news:...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hitting enter or shift+enter in asp.net designer messes up html code? Sunfire ASP .Net 2 11-06-2007 02:44 PM
How to disable imagebutton postback when i enter "enter" =?Utf-8?B?am9l?= ASP .Net 0 09-28-2006 06:46 AM
capturing from text area Shft+Enter, Control+Enter, Alt+Enter and browser issue. HopfZ Javascript 0 08-28-2006 10:11 AM
Enter Key H*ll, control enter key submit button BrianDH ASP .Net Web Controls 3 01-12-2005 08:29 PM
trigger HTML button by enter ENTER key Matt Javascript 1 03-06-2004 07:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57