Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


session and selected value

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,57055
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> session and selected value
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 session and selected value - 2/24/2008 10:18:21 PM   
  collie

 

Posts: 10
Score: 0
Joined: 2/11/2008
Status: offline
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>
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> session and selected value Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts