Strange side effect with events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Thank you very much Karl, that was problem I've been dealing with for a while
now. I appreciate your knowledge and helpfulness.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top