Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 2nd, 2004, 10:47 AM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listboxes and Arrays

Hi all,

I have 2 select boxes. I want the 2nd to be populated depending on what is selected in the first. This is simple enough. The catch here is that I want the 2nd to populated from an array which is linked to the choice in the first. However each array is different in length. So what Im faced with is creating extra options each time, depending on how many elements there are in the array associated with the choice made in the first select box. So if the user selected option 1, there may be 5 elements in its array, but if they select option 2, there may be 7 in its array.

Ideas?

Cheers
interrupt

__________________
\'sync\' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
Reply With Quote
  #2 (permalink)  
Old August 2nd, 2004, 01:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You can access select options through the options property, as:

document.GetElementById('select1').Options

I think there is an add and remove, but am not sure.

Brian
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listboxes Sub-Listboxes and Table Linking MJB05 Access 4 September 20th, 2005 12:37 PM
Listboxes and Arrays(Cot'd)... interrupt Javascript How-To 2 August 10th, 2004 11:03 PM
Filtering listboxes Bill Snow VB Databases Basics 0 February 5th, 2004 03:32 PM
Listboxes Alaric VS.NET 2002/2003 1 October 29th, 2003 11:54 AM



All times are GMT -4. The time now is 10:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.