www.webdeveloper.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Location
    Springfield, MO
    Posts
    71

    Multiple Selected Options

    I am trying to create two listboxes, one containing a list of email addresses and the other an empty box that i will pass those addresses to. I then want to send those addresses to the next page to be used in a mail script. how do i get the addresses on the second page. i use js to pass from one box to the other. will that affect my posting on the form?

    These are the two boxes:

    Code:
    			<td height="85">
    			<select size="5" name="lcl19" id="lcl19" multiple>
    			</select>
    			</td>
    			<td align="center">
    			<INPUT TYPE="BUTTON" VALUE="<-" ONCLICK="delIt();"></INPUT><br>
    			<INPUT TYPE="BUTTON" VALUE="->" ONCLICK="addIt();"></INPUT>
    			</td>
    			<td>
    			<select  NAME="PickList" ID="PickList" SIZE="5" multiple align="right" >
    				<option></option>
    				<option value="evan.moon@marisolintl.com,check">evan.moon@marisolintl.com</option>
    				<option value="jason.descamps@marisolintl.com,">jason.descamps@marisolintl.com,</option>
    				<option value="terri.howard@marisolintl.com,">terri.howard@marisolintl.com,</option>
    				<option value="bruce.chilton@marisolintl.com,">bruce.chilton@marisolintl.com,</option>
    				<option value="marty.mitchell@marisolintl.com,">marty.mitchell@marisolintl.com,</option>
    			</select>
    			<br>
    			</td>
    And this is how I'm trying to call it:

    Code:
    email=request("lcl19")
    If you need to see the javascript involved let me know.

    Thank you
    Buzzards got to eat same as worms.

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Depending on how JS handles this type of thing (I cannot be certain without first testing it), I would assume only the selected items will be passed to the server. So, you may need to modify your JS to also generate a value for a hidden field in your form on the fly.

    So, when a new address is added to the empty selectbox, also add that address to a <input type="hidden"> element on the page. You will have to rewrite the contents of the hidden field each time a new address is added or removed.

    There is definately a more elegant way of solving this problem, but it's past midnight and this the best I can come up with!

    Cheers,
    Andrew Buntine

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



Recent Articles