desabilitar ENTER com javascript

Standard

<script language=”JavaScript”>
function AnalizaTeclas()
{
var tecla=window.event.keyCode;
if (tecla==13) {event.keyCode=0; event.returnValue=false;}
}
//–>
</script>
<body onKeyDown=”AnalizaTeclas()”>

ou

if (window.event.keyCode == 13)
{
event.returnValue=false;
event.cancel = true;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.