Disable form submit on enter

<form action="sent.asp" method="post" onkeypress="return disableEnterKey(event);">

<script language="JavaScript">
function disableEnterKey(e)
{
var key;

if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox

if(key == 13)
return false;
else
return true;
}
</script>

0 Comments

You must be logged in to post a comment.