I'm attempting to change the focus on a RadConfirm popup form to be on the cancel button as opposed to the OK button as is set by default. In order to do this, I've added a ConfirmTemplate to my WindowManager as follows:
<div class="rwDialogPopup radconfirm">
<div class="rwDialogText">
{1}
</div>
<script type="text/javascript">
function radwindowprompt_setfocus() {
var container = document.getElementById("buttonContainer");
var but = container.getElementsByTagName("A")[1];
but.focus();
}
</script>
<div id="buttonContainer">
<a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);" ><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span></span></a>
<a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Cancel]##</span></span></a>
</div>
</div>
I've also set the OnClientShow event to run adwindowprompt_setfocus when the window is shown.
This only seems to work when I set a breakpoint in Firebug and step through. When I just run it, this doesn't seem to work at all.
Any suggestions?