Thursday, 20 February 2014

Disable Enter Key Using Javascript In Asp.Net

 In this article i will show you how we can dispable the ente key using javascript in asp.net.

So here we go create a new asp.net web application and add a new page and add the below javascript code at the header of the page


<script type="text/javascript">
function DisableEnterKey() {
if (event.keyCode == 13) {
return false;
}else {
return true;
}
} 
</script>

Now call this code at the body tak of the page.

<body onkeydown="javascript:return DisableEnterKey()">

now run the page check the output.

Tags: Asp.Net , Javascript

No comments:

Post a Comment