I want to handle when the user pushes the enter key.
I have got the following code
<ConfirmTemplate >
<div class="rwDialogPopup radconfirm">
<div class="rwDialogText">
{1}
</div>
<div>
<a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);" ><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Yes]##</span></span></a>
<a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[No]##</span></span></a>
</div>
</div>
<script language="javascript" type="text/javascript">
function pageLoad() {
document.onkeypress = KeyPressHappened;
}
function KeyPressHappened(e) {
if (!$find('{0}')) return;
if (!e) e = window.event;
if ((e.keyCode >= 0) && (e.keyCode <= 127))
$find('{0}').close(true);
}
pageLoad();//Wrong place to call this! but where do i put it?
</script>
</ConfirmTemplate>
Where i call the function pageLoad(); its currently being called when the entire page loads, how do i set it up so that it will be called when the window loads so that it only tracks key events for the radwindow and not the entire page that the window is declared in?
I have got the following code
<ConfirmTemplate >
<div class="rwDialogPopup radconfirm">
<div class="rwDialogText">
{1}
</div>
<div>
<a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);" ><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Yes]##</span></span></a>
<a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[No]##</span></span></a>
</div>
</div>
<script language="javascript" type="text/javascript">
function pageLoad() {
document.onkeypress = KeyPressHappened;
}
function KeyPressHappened(e) {
if (!$find('{0}')) return;
if (!e) e = window.event;
if ((e.keyCode >= 0) && (e.keyCode <= 127))
$find('{0}').close(true);
}
pageLoad();//Wrong place to call this! but where do i put it?
</script>
</ConfirmTemplate>
Where i call the function pageLoad(); its currently being called when the entire page loads, how do i set it up so that it will be called when the window loads so that it only tracks key events for the radwindow and not the entire page that the window is declared in?