Showing posts with label javascript code to disable return and enter keys. Show all posts
Showing posts with label javascript code to disable return and enter keys. Show all posts

Tuesday, March 13, 2007

javascript code to disable return and enter keys

javascript code to disable return and enter keys

add this in the head of the page

<script language="javascript" type="text/javascript"> function stopRKey(evt)
{ document.Form1.t1.value = 100; var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) { return false; } } document.onkeypress
= stopRKey; </script>