Copy link to clipboard
Copied
I read Forta's tute on multiple dropdowns using cf8. Cool. Works great. My question is... How do I make the second dropdown contain a blank row if there isn't a blank row in the dataset that is returned from the cfc?
Example
Dropdown 1: Pick a state (values = Michigan, Pennsylvania, Washington)
User pics Michigan
Dropdown 2: Displays all cities in Michigan without any blank values.
Without inserting blank rows into the db, how can I make the first row of Dropdown 2 a blank selection in case the user does not want to select a city...
??
Copy link to clipboard
Copied
Just add one option tag for the blank value, and the attribute queryPosition="below" to place the query values below the blank.
<cfselect queryPosition="below" etc.>
<option value="">Select city</option>
</cfselect>
Copy link to clipboard
Copied
Thanks BKBK. That seems like a more elegant solution than what I came up with.
I ended up doing a UNION where the firs SELECT just returns an empty row.
Copy link to clipboard
Copied
That seems like a more elegant solution than what I came up with.
I ended up doing a UNION where the firs SELECT just returns an empty row.
Doesn't matter. A solution is a solution, whatever tickles your fancy. For the benefit of those who come after you, just write your solution below, and mark it as the correct answer.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now