Eric Bourland
asked on
how to display selected option in a SELECT menu?
ColdFusion 9
Hi. I am having a little trouble. I am editing a record that contains data from a SELECT menu. When I view the edit page, how can I get the form to display the selected value in the SELECT menu? Here is what I have so far:
Thank you as always. =)
Eric
Hi. I am having a little trouble. I am editing a record that contains data from a SELECT menu. When I view the edit page, how can I get the form to display the selected value in the SELECT menu? Here is what I have so far:
<!--- this query selects PresentationFormat from lookup table LookupPresentationType --->
<cfquery datasource="#APPLICATION.dataSource#" name="GetPres">
SELECT PresentationFormat
FROM LookupPresentationType
</cfquery>
<p>Indicate whether you are submitting for an oral paper, poster, or either format.</p>
<select size="4" name="PresentationFormat" multiple="no">
<option value="">Select Presentation Format:</option>
<cfloop query="GetPres">
<cfoutput>
<option value="#GetPres.PresentationFormat#" <CFIF editAbstract.PresentationFormat IS (not sure what goes here... but you see where I am going with this)>selected</CFIF> >#GetPres.PresentationFormat#</option>
</cfoutput>
</cfloop>
</select>
Thank you as always. =)
Eric
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked like a charm.
Thanks as always, gdemaria. Hope you are great, and enjoying the summer.
Eric