Debmedia Creation Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Asp.net Disabling Tab Key in Page

Go down

Asp.net Disabling Tab Key in Page Empty Asp.net Disabling Tab Key in Page

Post  Admin Sat Mar 20, 2010 1:51 pm

Javascript code:

<script type="text/javascript">
function cancelKey(e) {
var e=(window.event)? event : e;
if (e.keyCode==9) { // Tab
if (window.event) {
window.event.returnValue=false;
}
else {
if (e.cancelable ) {e.preventDefault();}
}
}
}
document.onkeydown=cancelKey;
</script>


Asp.net VB.Net Code

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Button1.Attributes.Add("onkeydown", "return cancelKey(e)")
End Sub
Admin
Admin
Admin

Posts : 256
Join date : 2008-06-06

https://debmedia.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum