473,395 Members | 1,969 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,395 software developers and data experts.

Button should not be the default control when pressing enter

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.
Nov 19 '05 #1
1 1514
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.


Nov 19 '05 #2

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

Similar topics

1
by: Matt | last post by:
<input type="button" onClick="doSomething()"> When the user click HTML button, it will launch doSomething(). But I want the user enter ENTER key, it will have same effect. Please advise....
0
by: Ollie | last post by:
When a form has a default button (Form.AcceptButton) and\or a shortcut key for that button (e.g. "&Process") and this button happens to close the form when clicked. Why does the control that...
6
by: Paul Turley | last post by:
Does anyone have some sample script to "press" a button or image button when the user presses the Enter key? I see this behavior on a lot of web pages but I'm not finding any samples. Thx --...
3
by: Philip Townsend | last post by:
I have an aspx page that contains 2 user controls, each containing a seperate textbox and button. I would like to specify that one of the buttons recieve focus when the page loads. Also, I would...
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: Dan Brussee | last post by:
I have a form with 2 or more buttons. How do I control which one will fire when I press the Enter key? In traditional ASP, I could create 2 or more forms, each with their own Submit buttons. Since...
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()...
1
by: Joey | last post by:
I have an asp.net 1.1/C# web form with a text box server control and one button server control. Users can type in text to search and then click the button to start the search. I want them to be...
24
by: MichaelK | last post by:
Who knows how to prevent submitting a form on the press Enter button before all fields on the form are filled up. People just enter the first field hit Enter and it submits the form and doing...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.