[thelist] adding an option to a select element

david.landy at somerfield.co.uk david.landy at somerfield.co.uk
Tue Jun 15 06:40:33 CDT 2004


hi all,

i want to present my users with a list of groups they can join in a
<select>, and allow them to select a group and then click a button to join
it. 

the selected group should then appear in a second <select>, showing all the
groups they have joined. a second button will allow them to reverse the
procedure and leave a group. 

a quick pic (group names are made up):

  your groups             available groups
 --------------            --------------
|gym           |          |athletics     |
|horse-riding  |          |soccer        |
|squash        |    <==   |rugby         |
|tennis        |          |golf          |
|              |    ==>   |table-tennis  |
|              |          |scrabble      |
|              |          |ludo          |
|              |          |bingo         V
 --------------            --------------

does anyone have any sample javascript code for this, or pointers to how to
do it elegantly? i can get the data in and out of the database without a
problem, and have got as far as removing an <option> from a <select> but am
stuck on how to add an <option> to the second <select>.

thanks in advance,

david

-- 
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.



More information about the thelist mailing list