Aşağıda sana uygun bi kod yazdım. İşini görebilir.
<html>
<head>
<script type="text/javascript">
function submitenter(e, button_id) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13) {
document.getElementById(button_id).click();
return false;
}
else
return true;
}
</script>
</head>
<body>
<input type="text" onkeypress="return submitenter(event,'btnSubmit')">
<input type="button" id="btnSubmit" onclick="alert('Pressed.')" value="OK">
</body>
</html>
|