• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Are there any tool for automating the TABINDEX process?

Hi,

I have a form with a lot of fields on it that my new candidates complete when they are submitting a resume to me.  I understand the TABINDEX process, but it is a HUGE PAIN doing each field manually, especially if you have to add a new field in the middle and it throws all the other numbers off.

Has someone created a GUI type tool that works kind of like the Tab Order Editor in Access, where it searches my form for all fields, lists them, I can move em around and it writes the correct TanIndex to each one?

I have DreamWeaver and from what I can tell, it doesn't have this feature (although, IMHO, it should).

Any ideas on this one?

Thanks,

M
0
MitchellVII
Asked:
MitchellVII
  • 4
  • 4
  • 3
1 Solution
 
jmar_clickCommented:
If your form is fairly linear than maybe you can consider omitting the tab index numbers and have the form auto index itself.
0
 
MitchellVIIAuthor Commented:
lol,

no, its not, that's sort of why i asked the question, but thanks :)

M
0
 
jmar_clickCommented:
Can you post or send a sample of the form you use? A custom script can be writen to go through the form as its loading and assign tabindexes by incrementing a variable.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
MitchellVIIAuthor Commented:
yes but how would the custom script have any idea what order I wanted the fields in?
0
 
ysreCommented:
You would have to supply eg. an array of ids which it would simply walk while setting the correct tabindex :)
You can use an array of names as well, but id (document.getElementById(..)) is more to my liking :)

Then body.onLoad walk this array eg. like this:

var myindex = new Array ('id1', 'id2', 'id3', ..., 'id197');

function onload_setuptabindices()
{
  for (var i=0; i < myindex.length; i++)
  {
    var el = document.getElementById (myindex[i]);
    if (el)  // if element was found
    {
      el.tabIndex = i; // to use exactly the order of myindex for the tabindex :)
    }
  }
}

Good luck,
Ys
0
 
jmar_clickCommented:
yeah...what ysre said
0
 
MitchellVIIAuthor Commented:
Is there a:

.getElementByName as well?
0
 
ysreCommented:
Nope, there's just .getElementsByName and .getElementsByTagName ..
Both return an array of objects in your page that match the criteria (ie. name or tagname).

Which is why I favor .getElementById :)

Ys
0
 
MitchellVIIAuthor Commented:
Not all of my elements have ID's.  Why?  Cause I'm lazy. :)

What I really need to do to make this setup workable is to have some code which cycles through my form for me and creates a vertical column of all the field names.  Then I can cut and paste em into the order I want and have the code cycle down through the column and assign the tab index.

If we could make it do that, THAT would be cool.

If we can't make it work with a column, then something which generated a comma delimited list of all the tab-able field would do :)

M

Can you create an array based upon a column of numbers rather than a comma delimted list?
0
 
ysreCommented:
So how will this code guess correctly the displaying order of elements?

I guess you could go through a set of tagname arrays (eg. INPUT, SELECT, A), save the start x, start y, end x, end y position for every single element (in a crossbrowser way, thanks IE -.-) and then find out if there are any commonalities.
EG. is there a significant amount of elements that starts around (!) x position 137 (+- what you define).

And then when you finally got a sorting for your lists of elements  you can actually set a tabindex to it.

Doesn't sound like something someone lazy would want to do.

Be lazy, add unique ids to all the fields (once) and (once) create a list of unique ids to get the order right (once and for all).

And on the PS question:
Sure, just replace the 'fooid' with eg. 137.. Only you wouldn't know what element this is referring to.
Eg. if the webserver (or simply you) added a single element before any known (no. of) element  you would have to add the appropriate amount on every single id below that.. Lazy, eh? :P

Bye,
Ys
0
 
ysreCommented:
Thanks for the credits :)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now