Asp.net Disabling Tab Key in Page
Page 1 of 1
Asp.net Disabling Tab Key in Page
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
<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
Similar topics
» ASP.NET - How to refresh a page from another page
» ASP.NET to get one variable value to another page
» ASP.NET How to send mail from web page
» Closing Asp.net Page Session
» ASP.NET to get one variable value to another page
» ASP.NET How to send mail from web page
» Closing Asp.net Page Session
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum