Link to home
Start Free TrialLog in
Avatar of Eric Bourland
Eric BourlandFlag for United States of America

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:

<!--- 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>  

Open in new window

               

Thank you as always. =)

Eric
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eric Bourland

ASKER

Of course. =) Why could I not wrap my head around that?  =)

That worked like a charm.

Thanks as always, gdemaria. Hope you are great, and enjoying the summer.

Eric