i have this code:
<a href="#openModal">Open Modal</a>
<div id="openModal" class="modalDialog">
<div>
<a href="#close" title="Close" class="close">X</a>
<h2>Modal Box</h2>
<input type="radio" value="rdRec" checked="checked" />Rec
<input type="radio" value="rdPot" />Pot
<input type="button" id="btnOk" value="ok" onkeypress="checkey();">
</div>
<script type="text/javascript">
function checkey()
{
var code = window.event.keyCode;
if(code == 13)
{
document.getElementById('btnOk').click();
return false;
}
}
</script>
All i want is when the popup is open and the radio button Rec is select/checked i want to click on enter key and automatically trigger the btnOk...