session and selected value

Author Message
collie

  • Total Posts : 11
  • Scores: 0
  • Reward points : 0
  • Joined: 2/11/2008
  • Status: offline
session and selected value Sunday, February 24, 2008 11:18 PM (permalink)
0
Hi,
 
I have the following code that creates and populates a dropdownlist.
I have a session called DDLSearchWithin  that gets its value from a querystring.
The ddl appears as follows:
<select name=kbid>
<option value=1>Pink
<option value=2>Red
etc..
 
DDLSearchWithin contains Pink or Red etc and not 1 or 2.
I need to add another session called searchkbid and give it the value 1 or 2 based on what the value of DDLSearchWithin is.
The ddl gets selected with the value from the session DDLSearchWithin as can be seen in the code below.
How can I assign the value 1 or 2 to the session searchkbid  according to the selected value in the ddl?
 
Thanks
 
 
 
 
if sscope = "kb" then
  
      sqlStr = "select distinct kba_id, kba_name, cpk_order from tb_knbCPortalKB, tb_knbKnowledgeBase, tb_knbArticleGroupAccess, tb_knbCPortalUserSecurity, tb_knbArticle order by cpk_order, kba_name"
  
  end if
  
  set rsSearch = dbconnSearch.Execute(sqlStr)
  %>
  <% if not rsSearch.eof then %>
  <tr>
    <td>
  <select name="kbid" class="defaultText" onchange="setSearchWithin();document.searchform.search.value = 0;document.searchform.kbchange.value=1;document.searchform.submit();">
<%
  
  
  do while not rsSearch.eof
   rsSearch.MoveNext
  loop
  
  rsSearch.MoveFirst
%>

 
<%
  
  do while not rsSearch.eof %>
<% if (session("DDLSearchWithin")<>"") then %>
<option value="<%=rsSearch("kba_id")%>"

<%if session("DDLSearchWithin") & "" = rsSearch("kba_name") & "" then%>
 selected<%end if%>> <%=rsSearch("kba_name")%>


<%else%>
  <option value="<%=rsSearch("kba_id")%>"<%if session("searchkbid") & "" = rsSearch("kba_id") & "" then%>
 selected<%end if%>> <%=rsSearch("kba_name")%>
<%end if%>
  <%  rsSearch.movenext %>
  <%  loop %>
  </select>
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9