Steve Lefevre wrote:[color=blue]
> I have a series of selectboxes on a web form. I would like to have a
> javascript jump the focus to the next selectbox when the user presses a key.
> Each box has the values 1 through 6-9, depending. So normally someone who is
> used to it can just hit 1 <tab> 3<tab> 5<tab>1<tab>9<tab> -- I'd like to
> take the tabbing out.
>[/color]
You are after the element tabIndex property, have a look here:
http://www.mozilla.org/docs/dom/domr...f.html#1002691
[color=blue]
> So what's really nice is if the box doesn't jump when the user doesn't
> select a proper value.
>[/color]
How can they not select a "proper value"? Perhaps you should
look at making sure the content of the select is only valid
values, rather than pestering the user if they can't guess what
is "proper" and what isn't.
[color=blue]
> I've been looking at java scripts and I'm not sure how to reference the next
> selectbox, or how to check that the key pressed was in the proper range. Can
> someone help me out?[/color]
Use the tabIndex property to control navigation. There is also
an item index (look for "item" method at the above reference):
element.item(index)
but that is based on the order the elements are placed in the
DOM tree and may not be the same order as your required
tabIndex.