Tuesday, April 3, 2012

asp.net text disable enter submit example

<script type="text/javascript">
function stopRKey(evt) {
   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;
   }
} //end func
</script>

now all u need
to do is to add it to the body.onkeypress
ps - this also does the job

< "body onkeypress="{if (event.keyCode==13) return;}>

1 comment:

  1. בחור נחמד וחכם ושמו בישראל אריאל בנימין בן ירון

    ReplyDelete