Hi,
The default behavior is that when onclick event is fired on the dropdown area, it will be closed.
And also note that an click event fired on an element inside the dropdown area will be bubbled to its parent, so this event will be fired on dropdown area too.
You may prevent the event from bubbling with the following code:
<input type="check" onclick="doSomething" />
function doSomething(e)
{
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation)e.stopPropagation();
}
Hope this helps.
Hi Raymond, I have the same problem. Could you please be more specific?
Thank you.
The key is add the above script function as an handler for the click event of CheckBox.
This function prevents the click event from bubbling to its parent.
No comments:
Post a Comment