Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Cancel Events
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 16th March 07:38
paul§¢|¦¢ëŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default Cancel Events



Hi
I have a <select> element that has both onChange and onClick events defined for it
<select onChange="myProc()" onClick=myProc()"
Every time I make a selection, both events a fired the same function is called twice
How could I make sure that myProc is called only once

I tried to use window.event.cancelBubble = true; at the end of myProc(), but that didn't help

Thank you in advance.
  Reply With Quote


  sponsored links


2 16th March 07:38
igor tandetnik
External User
 
Posts: 1
Default Cancel Events



Not assign the same handler to both events, perhaps?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
  Reply With Quote
3 16th March 07:38
igor tandetnik
External User
 
Posts: 1
Default Cancel Events


So you are getting what you have asked for. Two events happen, you get
two notifications. What seems to be the problem?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
  Reply With Quote
4 16th March 07:38
igor tandetnik
External User
 
Posts: 1
Default Cancel Events


Too bad the element does not have mind-reading abilities. It does not
really care about what you want, you know. It behaves the way it is
designed to behave. Your job is to deal with it.

What are you really trying to achieve? Can't you, for example, remember
the value of selectedIndex property in a global variable somewhere, and
ignore the event if the new value of the property is the same as the old
value?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666