Javascript tabindex forcing working fine in Firefox but not IE, HELP please!

S

ScottRoot2

In a nutshell... I have this old .asp page with a ton of form elements
(and I mean a ton...don't look at me I didn't make the page).

This creates a huge headache. My job is to make the tabindex of the
elements order properly. Instead of going through manually and trying
to adjust 300+ tabindexes I just made a script which worked fine in FF:

window.onload=function()
{
var count=0;
for (var i=0; i< form.elements.length; i++)
{
var ele = form.elements;
if(ele.type != "hidden" && ele.disabled != true)
{
ele.setAttribute('tabindex',count);
ele.onclick = function()
{
alert(this.tabindex);
}
count++;
}
}


}

This didn't past properly, but if anyone can tell me what the problem
is, I'd greatly appreciate it. The alert is just debugging for me to
see if the tabindex was set, and it IS! If I click element #5 in the
order it is the 4 (0-based) tab index! But when I actually do my
tabbing, it is all out of wack!

Please help!
 
I

Ivan Pesa

I `ve only heard bout oposite effect : IE 7 enables java scripts without
asking while Firefox has something like pop-up java script blockade
~~>meaning it doesnt allow java script to run on some page w/o asking user
be4
 
A

Adrienne Boswell

Gazing into my crystal ball I observed (e-mail address removed) writing in
In a nutshell... I have this old .asp page with a ton of form elements
(and I mean a ton...don't look at me I didn't make the page).

But as a developer you should have something to say about it.
This creates a huge headache. My job is to make the tabindex of the
elements order properly.

That can be problamatic in some cases. The best thing to do is to put
the form elements in their logical order, thereby removing the need for
tabindex.

Instead of going through manually and trying
to adjust 300+ tabindexes

You need to break the form up. No one is going to want to tab through
300 form elements. It's just too daunting.
I just made a script which worked fine in FF:

Be aware that a) not everyone uses FF, b) not everyone has javascript
enabled.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top