Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Capturing Selections from several multiple select boxes

 
M. Cotton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using javascript to capture multiple selections from a select box. I have the javascript written to capture from one select box but I have two other multiple select boxes on the form that I need to capture from as well. I am not sure how to go about doing this. Any suggestions would be greatly appreciated.
Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the issue? if you figured out how to do it for one, what's the problem with applying the same logic to another?
 
M. Cotton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess my question is do I need to recreate the same function 3 times and call it something else each time? Also, I have one onclick event which takes everything from the first select box, do I need to do some sort of loop to catch all three select boxes?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what does you code look like now?

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a function that you pass the element reference to. There's rarely any need to copy/paste code.
 
M. Cotton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought I had it right, but now the first box is giving me an error message. Maybe I have just been at this to long and it will make sense in the morning ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic