Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Button should not be the default control when pressing enter

Reply
Thread Tools

Button should not be the default control when pressing enter

 
 
George Homorozeanu
Guest
Posts: n/a
 
      07-19-2005
Hi,

I have an ASP.Net Page with some control on it (buttons, textboxes,
calender, etc). When I'm changing the text in the textbox I want to run some
code and change the date of the calendar. The problem is that when I press
enter, the code for the button event is called. It looks like the button is
the default action for pressing enter somewhere on the page. How can I
change that? The button is an asp button.

Thanks,
George.


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      07-19-2005
Why don't you use an <input type=button> instead and then attach your onclick
attribute to that? You can still make it runat=server if you'd like to work
with it on the server.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi,
>
> I have an ASP.Net Page with some control on it (buttons, textboxes,
> calender, etc). When I'm changing the text in the textbox I want to
> run some code and change the date of the calendar. The problem is that
> when I press enter, the code for the button event is called. It looks
> like the button is the default action for pressing enter somewhere on
> the page. How can I change that? The button is an asp button.
>
> Thanks,
> George.




 
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
Spring java Controller get correct data from button when "apply"button is clicked but not pressing the <Enter> key albert kao Java 1 04-10-2010 02:54 AM
multiple buttons - need to set default button when pressing enter key jyotsna Software 1 12-18-2007 08:51 PM
capturing from text area Shft+Enter, Control+Enter, Alt+Enter and browser issue. HopfZ Javascript 0 08-28-2006 10:11 AM
Pressing ENTER does not invoke the only SUBMIT button. Neo ASP .Net 2 05-11-2004 05:04 PM
Default button - pressing Enter Dan Brussee ASP .Net 3 02-24-2004 03:09 PM



Advertisments