Here is the HTML/Javascript code:
Code: Select all
<body><div id="container"><form id="queryForm" name="queryForm" method="post" action="/npsgui/jsp/query.jsf" enctype="application/x-www-form-urlencoded"><div id="header" class="pageQuery"><div id="navigation">
</td><td class="borderQuery fieldLabelRight" style="width: 130px;"><div><a href="#" onclick="if (!confirm('Are you sure you want to lock this order?')) { return false; };return oamSubmitForm('queryForm','queryForm:_idJsp20');" id="queryForm:_idJsp20" class="btnCommand">Lock</a><div style="clear: right;"/></div></td></tr><tr><td colspan="3">
Code: Select all
wb := WBGet("NPS GUI") ;IE instance already open
if (wb)
{
;click lock order
wb.document.getElementById("queryForm:_idJsp20").click() ;lock order which bring up the annoying popup window where I have to click ok
send {enter} ;fail
wb.document.getElementsByName("oamSubmitForm")[0].setAttribute("onClick").value = "" ;fail
sleep 1000
IfWinActive, ahk_class #32770
SetControlDelay -1
ControlClick, Button1, ahk_class #32770 ;failed
}