473,473 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Strange side effect with events

I have a text box with a seperate "submit" button which triggers an event
handler to process the text in the textbox. I also wanted to allow a user to
press enter to get out of the textbox and process the text. I wired up
another event handler for the textbox for the 'text changed' event. The
problem is when a user enters after writting text in text box the 'text
changed' event fires AND a random event for a whole seperate button at the
top of the page also fires. I tried to figure out the problem by disabling
that particular button but, some other random button started acting the same
way. If anyone has had this problem or knows the solution please let me
know.
Thank you,
Giancarlo
Nov 19 '05 #1
2 1036
What you want to do is tie the enter button of the textbox to the save
button being clicked.

What's happening is when you press enter, the first submit button on the
form is being fired - which is clearly not the save button.

Check out:
http://www.allasp.net/enterkey.aspx

which has a helper method that ties the enter of a textbox to the button of
your choice.

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Giancarlo" <Gi*******@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
I have a text box with a seperate "submit" button which triggers an event
handler to process the text in the textbox. I also wanted to allow a user to press enter to get out of the textbox and process the text. I wired up
another event handler for the textbox for the 'text changed' event. The
problem is when a user enters after writting text in text box the 'text
changed' event fires AND a random event for a whole seperate button at the
top of the page also fires. I tried to figure out the problem by disabling that particular button but, some other random button started acting the same way. If anyone has had this problem or knows the solution please let me
know.
Thank you,
Giancarlo

Nov 19 '05 #2
Thank you very much Karl, that was problem I've been dealing with for a while
now. I appreciate your knowledge and helpfulness.

"Karl Seguin" wrote:
What you want to do is tie the enter button of the textbox to the save
button being clicked.

What's happening is when you press enter, the first submit button on the
form is being fired - which is clearly not the save button.

Check out:
http://www.allasp.net/enterkey.aspx

which has a helper method that ties the enter of a textbox to the button of
your choice.

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Giancarlo" <Gi*******@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
I have a text box with a seperate "submit" button which triggers an event
handler to process the text in the textbox. I also wanted to allow a user

to
press enter to get out of the textbox and process the text. I wired up
another event handler for the textbox for the 'text changed' event. The
problem is when a user enters after writting text in text box the 'text
changed' event fires AND a random event for a whole seperate button at the
top of the page also fires. I tried to figure out the problem by

disabling
that particular button but, some other random button started acting the

same
way. If anyone has had this problem or knows the solution please let me
know.
Thank you,
Giancarlo


Nov 19 '05 #3

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

Similar topics

1
by: Luigi | last post by:
I noted a particular behavior shown by IE. Look at the simple page attached at the bottom of the post. In it, there is a box floated with the float property and another box that jumps it with the...
3
by: Andrew Mayo | last post by:
(note: reason for posting here; browser helper object is written in C++; C++ developers tend to know the intricacies of message handling; this looks like a Windows messaging issue) Microsoft...
31
by: Bjørn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
2
by: exshige | last post by:
I read from some book that you can actually on any tag in the html page put a onClick or something and assign it with the sub/function name that is in the codebehind. I tried but it say name...
14
by: James Wong | last post by:
Hi! everybody, I'm facing a quite strange download problem. I use the following code to download an XML file to client side: With Response ' clear buffer Call .Clear() ' specify the...
5
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and...
7
by: Tim_Mac | last post by:
hi, using .net 2.0, i have a web form with lots of textboxes, drop-down-lists etc. There are lots of required field validators and regular expression validators. When i click the 'save' button,...
20
by: SpreadTooThin | last post by:
I have a list and I need to do a custom sort on it... for example: a = #Although not necessarily in order def cmp(i,j): #to be defined in this thread. a.sort(cmp) print a
6
by: Senthil | last post by:
Hi, Whenever i read a C++ book or a newsgroup posting, i come across the terms like " before the side effects completes" , "destructor with side effects" etc. What is this side effect mean in C++...
20
by: Pilcrow | last post by:
This behavior seems very strange to me, but I imagine that someone will be able to 'explain' it in terms of the famous C standard. -------------------- code -----------------------------------...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.