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;}>

Comments

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

    ReplyDelete

Post a Comment

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

JS/JQ simulate Enter event

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem