:: Forum >>

onclick event from button does not work

Hello,

If you put a button in a div that's hidden when the page is loaded, the onclick event does not work.
For example, if you have a hidden dhtml pop-up dialig box that asks the user to confirm something by clicking on a button, the onclick event does not work for this button when the dialog box is popped-up after a certain action.

If you set visibility to visible when the page is loaded, then the button works fine. Only if you set visibility to hidden when the page is loaded, the button does not work.

Is this a bug?
Dries GERIS
Sunday, August 17, 2008
I cannot reproduce this. The button onClick event fires as usual -

<div id="hidden" style="display: none;">
<script>

    var obj = new AW.UI.Button;
    obj.setControlText("Button");
    obj.onClick = function(){
        alert(1);
    }
    document.write(obj);

window.setTimeout(function(){
    document.getElementById("hidden").style.display = "block";
}, 1000);

</script>
</div>
Alex (ActiveWidgets)
Tuesday, August 19, 2008

This topic is archived.


Back to support forum

Forum search