[jQuery] Re: label fires click function twice

2007-12-27 Thread mnosal
Right. Adding return false; stops the event bubbling and the function is called only once. (and the selector should have been '#r1' - typo.) Thx. --Mike On Dec 26, 9:55 pm, Shawn <[EMAIL PROTECTED]> wrote: > Remember event bubbling is taking place for ALL events. > > I suspect you will need to

[jQuery] Re: label fires click function twice

2007-12-27 Thread Yılmaz Uğurlu
May be you are binding same event more than once. Can you check it out? 2007/12/27, Shawn <[EMAIL PROTECTED]>: > > > Remember event bubbling is taking place for ALL events. > > I suspect you will need to stop the event propagation to resolve this > issue. This can be done one of two ways: > > 1) R

[jQuery] Re: label fires click function twice

2007-12-26 Thread Shawn
Remember event bubbling is taking place for ALL events. I suspect you will need to stop the event propagation to resolve this issue. This can be done one of two ways: 1) Return false from your click handler function. $("#r1").click(function () { window.console.log("hello"); return false;

[jQuery] Re: label fires click function twice

2007-12-26 Thread Hamish Campbell
I've seen the same behaviour outside of jQuery - something to do with the way 'for' sends events to the target element. Can't remember how/if I fixed it, but you could ditch the label and use jQuery to emulate the label functionality. Not a bad option considering not all browsers support labels c