Subj : Re: Controlling tab order with JavaScript To : netscape.public.mozilla.jseng,comp.lang.javascript From : Mark Reginald James Date : Sun Sep 25 2005 02:12 pm ASM wrote: > Now we have creation of a new text-field on the fly ? Yes, for my original post I tried to boil the problem down to the simplest code that demonstrated the problem, but it turns out easier to automatically move to a newly created box rather than to a specific existing box. >> then >> the tab behaviour is activating the new box. >> I also have an onblur trigger that also creates >> the new box unless the onkeydown event has already >> created it. > > > do not undertsand ... onblur without keydown > how make you that working ? Sorry ASM, I also do not understand what you are saying. The idea is to allow a user to create a list of text boxes which may represent something like a list of responses to a question. Initially there is only one text box. But as soon as the user leaves that box with non-blank content, a new box in the list is automatically created. If they leave the box by clicking elsewhere, the new box is created, but focus is now where they clicked. But if they leave the box by pressing tab, I not only wanted the new box created, but also that focus move to the new box. In this way the user can create a list of options of any length just by typing them and tabbing to a new one. > >> The new box doesn't get the focus after a tab if you >> create it in the original box's onchange event. You >> have to use the original box's onkeydown/onblur combo. > > > onblur would have to be enough ... no? I don't think I'd properly tried onblur on its own, but tried just now and found it didn't work. Tab takes you to the box that was originally next in sequence, skipping the new box. I can post the code if anyone would like to see it. .