Fetch data and select data in CFSelect
I have 2 tables:
1. cities table (contains all cities in Nevada)
2. forms table (contains all forms that has an idcity field and refers to idcities in the cities table)
I run a CFSelect query to pull the list of cities from cities table
"<cfselect name="idcity" query="qCity" value="idcities" display="name" queryposition="below"><option></option></cfselect>"
So this list all the names of the cities in the drop-down and I can select and insert/update the idcities value (id number from cities table) into the idcity field (forms table).
However, when the page reloads, the CFSelect is not automatically selecting the previous selection (idcity field number). It automatically selects the blank <option>. I inspect the database and the idnumber was successfully inserted in the idcity field (forms table)
I think I need to run another query as "qForms" to fetch this data properly when the page reloads. but is it possible to have 2 queries (1 fetching the list of cities in the cities table to initiate the list and another query fetching the idcity field in the forms table to automatically select the data) in 1 cfselect?
I don't know what to do. Please help ![]()
