Firstly make sure that your button template uses #BUTTON_ATTRIBUTES# substitution string (note #BUTTON_ID# doesn't seem to work as expected here). Add a button id to the Attributes field, or otherwise ensure you can identify it with a jQuery selector.
Then in Post Element Text place some jQuery to extend the click event...
I figure this method should be pretty robust. Here's the code for copy/pastability:
<script>
var btnClick = $('#PX_MYBUTTON').attr('onclick');
$('#PX_MYBUTTON')
.removeAttr('onclick')
.unbind('click')
.click(function(e){
if (confirm('Confirm message.')) btnClick(e);
});
</script>
No comments:
Post a Comment