Skip to main content
June 4, 2013
Question

Retain values of a multi select dropdown after submit

  • June 4, 2013
  • 1 reply
  • 572 views

HI,

I have a requirement where use can mutli select in a dropdown and click on search , Once the search is clicked it query the db and provides the result.

My question is how to retain the values of teh mutli select dropdown, Below is the select where i have to code

<SELECT NAME="category" size = "5" multiple="multiple" id="category" onchange="validate()">

<CFLOOP QUERY="categorylist">

                                        <OPTION VALUE="#category#"<CFIF category IS thecategory> SELECTED STYLE="background-color:#app.field_highlight#"</CFIF>>#category_name#</CFLOOP>

</SELECT>

Can someone help

Thanks in Advance

This topic has been closed for replies.

1 reply

p_sim
Participating Frequently
June 6, 2013

<cfif ListFindNoCase(theCategory, category)>

This will select each category that is listed in theCategory.