Monday, 8 February 2010

ASP.NET Checkbox click on label calling click event twice in JQuery

I don't know this is a known issue in Mozilla Firefox browser. When I use ASP.NET checkbox on a web page, it will render as a input control plus label. So, when I click on checkbox or label the click event raises and checkbox  state changes. But, I figured out  a strange behavior. When I click on the label the click event is raising twice when I use JQuery [I didn't try with  javascript]. But, where as when I click on checkbox it is raising click event only once. How to solve this problem? I have tried so many ways to solve the problem. But, didn't success.
I have tried by using type of the control. If type is checkbox then only go inside or just do nothing. When I click on label, it is coming to click event and every time, all lines are executing. I don't know why this is happening. Wheat I understood is, when we click on label then internally it is again generating click event for the checkbox because of the label for attribute. So, take care of it.
And if you find any solution to this problem, please let me know.

No comments:

Post a Comment