Asp.net Disabling Tab Key in Page

View previous topic View next topic Go down

Asp.net Disabling Tab Key in Page

Post  Admin on 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
avatar
Admin
Admin

Posts : 256
Join date : 2008-06-06

View user profile http://debmedia.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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