Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using CFselect

Status
Not open for further replies.

ahksar

Programmer
Jan 11, 2001
43
US
I have a question in dynamically populating select boxes. How can I highlight the value that is already in the database, for instance, if I am pulling out the list of countries, and the country in the database is US, how can the selected value in the select box be set to US?How can i make it show up instead of nothing, or a default value being selected.

Thanks
ahksar
 

<select name=&quot;selectCountry&quot;>
<cfoutput query=&quot;countries&quot;>

<option <cfif usaStates EQ &quot;Colorado&quot;>selected</cfif>>#usaStates#</option>

</cfoutput>
</select>


:) Sylvano
dsylvano@hotmail.com
 
Thanks a lot.....saved me a lot of headache:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top