• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

multiple selections

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've two select boxes in a form, the first being a multiple select, with the following code so that it's "sticky" ie just click to select/unselect items rather than holding ctrl or shift.

function AdvancedSelect(j) {
var oDropDown = document.myform.myselect;
arrMyDropDown[j] = !arrMyDropDown[j];
for(var i=0;i<oDropDown.options.length;i++) {
oDropDown.options[i].selected=arrMyDropDown[i];
}
}

...

<select name="myselect" onChange="AdvancedSelect(this.options.selectedIndex);" multiple size="10">
...
</select>

I now need to populate the 2nd select box with options corresponding to selections which are stored in arrays.

i.e. if the user selects option 1 and 3 from the first select box, then the 2nd select box will be populated with data from arrays
data[1] and data[3]

the arrays are setup like.......

data [1] [0] = "bob"
data [1] [1] = "steve"
data [1] [2] = "dave"
data [1] [3] = "simon"

data [3] [0] = "paul"
data [3] [1] = "tom"
data [3] [2] = "mike"

I hope this is enough information of what I want to achieve, any examples would be very helpful.

Many Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look for double combo scripts, you will just have to loop multiple times due to multiple selections.
 
Poonam Advani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot.

I got that
Shruti
 
reply
    Bookmark Topic Watch Topic
  • New Topic