list box select

Results 1 to 2 of 2

Thread: list box select

  1. #1
    lori laghlin Guest

    Default list box select

    i am refreshing a same page and when the page loads the values selected in the listboxare disappearing.i know how to do this when it is a compbo box(&#060;%if request("field") = rs("field") then%&#062;selected&#060;%end if%&#062;)<BR><BR>but how to do when the user selects multiple items in a list box.<BR><BR>please help me,thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: list box select

    If more values are selected, request("field") will return a comma-separated string, e.g.: "value1,value6,value8"<BR><BR>What I usually do to check if a single value is present in this string is this:<BR><BR>&#060;%if InStr("," & request("field") & ",", "," & rs("field") & ",") then%&#062;selected&#060;%end if%&#062;<BR><BR>It probably is not the most elegant solution, but i think it works.

Posting Permissions

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