Hi,
The way I see it you can either check for the existence of the value in the field using the insr() function, or you can split() apart the field and iterate it through a for each loop.
1st method:
-
<option value = "Food" <%if instr(rs("needlist"),"Food")>0 then response.write " selected"%> >
-
Second method is harder to describe as I would probably have a loop within a loop.
That is to say, rather than having statically typed values and conditionals in the page I would probably loop those initial select box values from an array (or db, if that's where they are stored), then iterate through the ones in the recordset to select them if necessary.
Probably didn't describe that the best way, so:
1st for each loop (data = the array of values for the listbox)
Put value into <option>
2nd for each loop (data = the rs field)
Check value, write "selected" if found.
Repeat 2nd loop
Repeat 1st loop
This way, every value you enter into the array will be checked, otherwise you have to copy and paste bits of code for each instance. Can get messy if many people can manage those values.
Make sense?
Gaz