Is it possible to populate a dropdown list with query results? For example with this output: Peps Company - AL ie (Company and State) separated with a hyphen.
Edit: Sorry for leaving out code. There is only one datasource.
<cfquery name="CompanyInfo" datasource=>
SELECT company, state
FROM clients
WHERE serv_billing = 1
AND status = 'Active'
ORDER BY Company
</cfquery>
<FORM METHOD="POST" ACTION="nextpage.cfm">
<SELECT name="company">
<CFOUTPUT QUERY="CompanyInfo">
<OPTION value="#CompanyInfo.company#">#CompanyInfo.company# - #CompanyInfo.state#</OPTION>
</CFOUTPUT>
</SELECT>
<INPUT TYPE="submit" VALUE="Submit Company">
</FORM>
Would this code give me the desired format for the dropdown list items ie Peps - AL?
?
The answer is yes. This code will do precisely that.
Does it not work? Do you have a problem with it, or..? I find it strange that you didn’t simply try it out because you already seem to have the code to do what you want to do.