Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Remove Tabindex for HTML Elements or Remove Tab Focus in Asp.net Controls

Sep 28, 2014
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.

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.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

0 comments :

Give your Valuable Comments

Other Related Posts

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.