Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabbing through only text fields

Status
Not open for further replies.

nrastogi

Programmer
Jul 19, 2002
52
US
Hi guys,

Please help me out in giving any ideas or solution to the following problem.

I have this table haiving 1 to n number of rows (set dynamically could be from 8 to 30). Each row has 4 columns.
Column 1 contains a link to some page, Column 2 is a Quantity field, Coulmn 3 is a description display, column 4 displays unit of measure, column 5 is again a link to some page.

Right now, if I tab through the fields, it goes to Col1, Col2, and then Col 5.

I just want to tab through the quantity field. The name of the quantity is field is a Product number, which could not easily be used to find out the next widget.

Please suggest me the easiest and quickest way to this problem.

I appreciate your time and help in advance.

Regards,
NRastogi

 
set the tabindex in the text box's
<input type=&quot;text&quot; name=&quot;Quantity&quot;tabindex=&quot;1&quot;>

not sure how you are generating the table but you can set this dynamicaly if needed in the quantity column
A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Thanks a lot for the suggestion.

I kinda did work. But, as soon as I tab through the last field, the control goes to the other fields and images on the pages.

I just want to use the tab for quantity field.

Please let me know how could I solve this.

Thanks,
NRastogi
 
You need to disable the field entirely that you don't want to tab to. Beware though, as well as not being able to tab to it, the value also won't be submitted and you can't enter the field at all.
Example
Code:
<input type=&quot;text&quot; disabled>
 
Hi HellTell,

The others that I don't want to tab through, are not a field. Those are the links appearing in each line.

So, my question is how to just tab to the first text field when it leaves the last one.

Thanks,
Nitesh
 
You can disable the links too. It sounds funny, but they are still clickable, but not tab stops.
Code:
<a href=&quot;yourpage.htm&quot; disabled>Link</a>

Not sure what else will work.
 

here's a theory...

create a javascript that senses the keyboard strikes; on tab press, run the script to count each time tab is pressed, maybe incrementing a var.

then, based on that variable number, you focus the element or table you want. then each time the tab is pressed, it runs the script and highlights the field accordingly. if you only want to tab through 3 fields, each time the var reaches 3, reset it to 1...

like i stated, it's theory...although i'm certain it's possible. although the tab will still cause the focus to move to the next field, it would refocus to the field you want and the transition should be barely noticeable, if at all...

too far fetched??

- g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top