How to order the textboxes in an html document by using HTML tag tabindex

In Visual Studio TabIndex is a property that is accessible in each control, I thought there was no equivalent in plain html. So what I did was to manually captured the control's (example textbox) onblur event. It was working well until I found a bug, when I have several sets of controls that are toggleable, means some could be hidden. I've encountered a locking event wherein the focus was lost and only F5 (refresh) is the solution.

On further googling, I've found out that tabindex is a property that is existing on > html 4 document. So I tried, fortunately it worked and all my problems were gone.

Sample implementation:

<input type="text" name="c1" tabindex="1" />
<input type="text" name="c2" tabindex="3" />
<input type="text" name="c3" tabindex="5" />
<input type="text" name="c4" tabindex="4" />
<input type="text" name="c5" tabindex="2" />

How to order the textboxes in an html document by using HTML tag tabindex How to order the textboxes in an html document by using HTML tag tabindex Reviewed by czetsuya on Wednesday, November 04, 2009 Rating: 5

No comments:

Powered by Blogger.