Introduction:
Here I will explain how to remove tabindex for html or asp.net controls or remove tab focus in asp.net controls or html controls.
Description:
In previous articles I explained jQuery regular expression to validate url without http(s), regular expression to validate phone number in jquery, regular expression to replace all special characters with spaces in c#, regex email validation in c# and many articles relating to validation, JQuery. Now I will explain how to remove tabindex for html / asp.net controls or remove tab focus in asp.net controls.
In previous articles I explained jQuery regular expression to validate url without http(s), regular expression to validate phone number in jquery, regular expression to replace all special characters with spaces in c#, regex email validation in c# and many articles relating to validation, JQuery. Now I will explain how to remove tabindex for html / asp.net controls or remove tab focus in asp.net controls.
To
remove tabindex for any control we need to set tabindex="-1" like as shown below
<input type="text" id="txt2" tabindex="-1" />
|
If
you want see it in complete example need to write the code like as shown below
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Remove Tab index from html elements</title>
</head>
<body>
<form id="form1">
<div>
Test1:<input type="text" id="txt1" tabindex="1" /><br />
Test2:<input type="text" id="txt2" tabindex="-1" /><br />
Test3:<input type="text" id="txt3" tabindex="2" />
Test4:<input type="text" id="txt4" tabindex="3" />
</div>
</form>
</body>
</html>
|
Live
Demo
To check live demo place cursor in first textbox and
click tab cursor will skip second textbox and will moved to third textbox
because we set tabindex="-1" for second textbox
Test1: Test2: Test3: Test4: |
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.