On Jan 17, 10:49*pm, StepanM <stepmikhay...@yandex.ruwrote:
Problem with event handling in FireFox. I have two controls on HTML
page: ListBox and TextBox (<selectand <input>). Both controls have
event "onchange" and functions for this event (e.g. select_onchange
and text_onchage). If I select item in ListBox, than I enter text in
TextBox, and than I finally select other item in ListBox, then both
events fires simultaneously (it can be checked up, if in both
functions write a corresponding "alert", both alerts appear
simultaneously). How to solve this problem?
It is very important.
Onchange can be difficult to program - it is supposed to fire when an
element loses focus, but some browsers don't wait for that for some
form controls while others do.
I expect what is happening in your case is that when you click on the
select the second time, that is when the text area loses focus and
fires its onchange event. Displaying the alert probably causes the
select to lose focus with perhaps a different option selected so it
too fires its onchange event.
You need to investigate using a different event for one or perhaps
both controls. Without knowing what you are actually trying to do, a
more precise solution can't be suggested.
Do you have a small example you can post, along with a description of
what you want to happen?
--
Rob