www.webdeveloper.com
Results 1 to 7 of 7

Thread: how to get unselected listbox <selected> tag

  1. #1
    Join Date
    Sep 2010
    Posts
    4

    how to get unselected listbox <selected> tag

    hi.. this is my first post
    need help

    i'm using asp classic and i don't know how to get unselected item from listbox


    1st page: mail-form.asp
    ================================================
    <form name="form1" method="post" action="send-mail.asp">

    <select id="theSelect" name="theSelect" MULTIPLE >

    <option value="1">First Option</option>
    <option value="2">Second Option</option>
    <option value="3">Third Option</option>

    </select>

    </form>

    ================================================

    2nd page: send-mail.asp
    ================================================
    <%
    'get selected item
    dim itemSelected, itemUnSelected
    itemSelected = Request.Form("selectedOptions")
    %>

    ================================================


    my question is: how to get Unselected Item in send-mail.asp from mail-form.asp?


    thx

  2. #2
    Join Date
    Sep 2010
    Posts
    4
    sorry, need correction for 2nd page: send-mail.asp

    ================================================
    <&#37;
    'get selected item
    dim itemSelected, itemUnSelected
    itemSelected = Request.Form("theSelect")
    %>
    ================================================

  3. #3
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    It depends. is your list a static list and always just 1,2,3?

  4. #4
    Join Date
    Sep 2010
    Posts
    4
    Quote Originally Posted by yamaharuss View Post
    It depends. is your list a static list and always just 1,2,3?
    no.. it's dynamic
    i have include file that retrieve the list from database
    Last edited by harisbudiman; 09-25-2010 at 05:23 AM.

  5. #5
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Well, not sure why you would need to know the UNselected values but you will need to run the same query on send-mail.asp that creates the original list in your include, then either create an array or loop through the RS and create an array of all the values that are not included in the request.form return.

    You might also be able to come up with some tricky way using Javascript on your form that places the unselected values in a hidden field.

  6. #6
    Join Date
    Sep 2010
    Posts
    4
    Quote Originally Posted by yamaharuss View Post
    Well, not sure why you would need to know the UNselected values but you will need to run the same query on send-mail.asp that creates the original list in your include, then either create an array or loop through the RS and create an array of all the values that are not included in the request.form return.

    You might also be able to come up with some tricky way using Javascript on your form that places the unselected values in a hidden field.
    i've 2 listboxes, first is list of recipients, when user click one of the recipient, they will move to the second list (unselected). that's why i need to know unselected values.

    sorry for wrong case i gave earlier, actually i don't need the "Request.Form" return.

    thx 4 ur help

  7. #7
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    This is more of a Javascript question. I would use an Ajax call to populate your second list and return all bot those selected in the first list.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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