Forum Moderators: open
I have created a recordset that diplays checkboxes all with the same name but have different values.
city = request.querystring("city")
city = Replace( city, ", ", "','" )
session("city") = city
Now when I revisit the page I would like the checkbox to be checked if the recordset("city") is found in session("city")
Can you explain to me what needs to be done.
Thanks
-Brahm
<%
if rs_city("city") = session("city") then
checked = "checked"
end if
%>
<input type="checkbox" name="city" value="<%=(rs_city("city"))%>" <%=checked%> >
the variable checked never = "checked" because the session("city") is an array. I need to know how to make the field rs_city("city") look to see if it is anywhere whithin the array.
I appreciate your help
Thanks
-Brahm
you could do this:
if (instr(1, session("city"), rs_city("city"), 1) > 0) then
checked = "checked"
end if
not sure how efficient that is without seeing the rest of your code, but i'm pretty sure it'll do the job.
-Matt