PDA

View Full Version : option tag



gcapp
03-03-2003, 04:24 PM
Can some one help me? I am new to Coldfusion and I am learning how ot code with it. I have this query code:

<CFQUERY NAME ="City" DATASOURCE="Kissaudio">
SELECT DISTINCT
Kiss_Shows.CITY
FROM Kiss_Shows
ORDER BY CITY asc
</CFQUERY>

and this code to fill in my drop-down list:

<cfform method="POST" action="body.cfm">
<cfselect name="showcity" query="City"
value="CITY"
display="CITY"
required="yes"
size="1">
</cfselect></p>
<br><input type="Submit" value="Pick A City">
</cfform>

I'm trying to insert an option tag, so when the drop-down list appears, the first selected value is "Choose A City". How do I do that in the the code above?

I'm trying to use my ASP knowledge to help, but I've found that the languages are not quite the same, so I'm not sure how to put tha option tag in the above code.

Thanks,
Gary

CFMX RULES
04-09-2003, 12:08 AM
<CFQUERY NAME ="City" DATASOURCE="Kissaudio">
SELECT DISTINCT
CITY
FROM Kiss_Shows
ORDER BY CITY asc
</CFQUERY>

<form method="POST" action="body.cfm">
<cfoutput query="city">
<select name="showcity">
<option value="#city#">#city#</option>
</select>
</cfoutput>

<br><input type="Submit" value="Pick A City">
</form>