views:

90

answers:

1

Given that

  1. The Browser has a page loaded with an exisitng field (call it ef) with tabindex=1,
  2. Two new fields are inserted via bookmarklet (nf1 and nf2)

'first time' (incorrect behavior) When the mouse is clicked on nf1 followed by a tab the focus acts as if the tab was entered from field ef and goes to a place other than nf2.

'second time' (correct behavior) Now, if the same actions were repeated i.e. mouse clicked on nf1 followed by a tab the focus goes to nf2.

One way I've ensured that the focus goes to nf2 from nf1 the "first time" around is to hardcode tabindex values to fields nf1 and nf2. But this is suboptimal as one needs to make sure that there are no tabindex conflicts i.e. if there are two fields where tabindex=1 than focus goes from one to the other instead of to the proximate tabindex=2

So, what can be done to ensure that the behaviour that manifests on the "second time" manifests on the first time.

ps: jquery is available on the page (if that helps.)

A: 

I rarely use the tabindex attribute so I haven't encountered this property. However, I have written interfaces with similar functionality (fields are added dynamically) with normal tab behavior. I would suggest just removing the tabindex attribute and see if that fixes the problem.

Justin Johnson
well, ef is on the original page authored by someone else, removing tabindex on bookmarklet insert does not alter the behavior.
molicule