Link to home
Start Free TrialLog in
Avatar of musclejack
musclejack

asked on

When I enter a value in the combo box and press the Enter-Key, the onTextChanged Event does not executed, instead it calls the Click Event of the first Button at the top the asp.net page.

When I enter a value in the combo box and press the Enter-Key, the onTextChanged Event does not executed, instead it calls the Click Event of the first Button at the top the asp.net page.
Avatar of ampapa
ampapa

So, what is your question?
onTextChanged event is called for each symbol typed in the text box. When you press Enter text is not changed, and event is not called.
What about the KeyUp event with keycode 13?
Avatar of musclejack

ASKER

It seems like when I hit the enter key, it will loop through and call all the functions in the page, and my question is after enter some text in the combo box, how can I call the onTextChangedEvent only when I press enter and not all the functions/events in the page
Your question shows that you don't need onTextChangedEvent at all. You don't want to validate text every time user presses a key. So, validate text in other place, for example, when user presses Submit button, or when textbox looses input focus.
Or you can call the same function both from onTextChangedEvent and from any other place.
ASKER CERTIFIED SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial