In an existing application I have the option to add some jQuery code, but cannot change the existing code. The application has several buttons with unique ID's. Now based on which button is clicked I would like to trigger an additional event next to the standard onclick function.
The default button code is:
'<button id="btnReopen" class="exButton" type="button" onclick="SysSet('BCAction', 7); SysSet('IgnoreValidationErrors', 1); SysSet('RQ_Reopen', 1); SysSet('Status', 0); SysSubmit(); fnSaveForm();" onmouseover="this.className='exButtonOver'" onmouseout="this.className='exButton'" onmousedown="this.className='exButtonDown'" accesskey="3" title="ALT 3 - Reopen" style="vertical-align:middle;"><span>Reopen</span></button>'
What I would like is that when this button is clicked an additional window is launched with a specific url. I tried something like the script below, however that triggers immediately on page load and in the same window
<script type="text/javascript">
jQuery( document).delegate( "#dCalc input[type='button']", "click",
function(e){
var idClicked = this.id;
});
if(idClicked = "BtnReopen") {
window.location="WflRequest.aspx?BCAction=0&Type=0&Description=Hello";
};
</script>