Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to display selected option in a SELECT menu?

Posted on 2014-07-30
2
Medium Priority
?
178 Views
Last Modified: 2014-07-30
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
0
Comment
Question by:Eric Bourland
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 2000 total points
ID: 40230707
Hi Eric!

You would want to match it up to the value you have putting in the VALUE tag: GetPres.PresentationFormat


<option value="#GetPres.PresentationFormat#" <CFIF editAbstract.PresentationFormat IS GetPres.PresentationFormat>selected</CFIF> >#GetPres.PresentationFormat#</option>
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
ID: 40230719
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
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question