Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Menu/List OnClick move to next form field.

Status
Not open for further replies.

JordanR

Technical User
Oct 3, 2002
182
US
Hello,
I was wondering if someone knew a simple solution for have the cursor move to the next form field after clicking an item in a list?

Any help would be greatly appreciated.
 
If the form fields are interspersed with the list items, then you can probably get away with using less code. However, I suspect this is not what you mean, so your best bet would be to address the form fields via name / ID, and call the focus method for each specific field you want to focus.

If you can provide more details about your list and form fields, then a more accurate answer can be given.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks for the response.
I have a simple form with two fields.
The first field is a list menu with several sizes listed. One size is selected by clicking on it. The next field is simply a input field for adding quantity, of course there is the submit button.

So, upon selecting a size, the cursor should automatically move to the quantity input field.

That's what I would like to happen.
Thanks!.
 
OK - My confusion arose from your incorrect terminology. Try this for size:

Code:
<form>
   <select onchange="this.form.elements['qty'].focus();">
      <option ... >
   </select>
   <input type="text" name="qty">
</form>

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
BillyRayPreachersSon,
that worked perfectly. apologize for the incorrect terminology.

Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top