Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: option tag

  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Posts
    247
    Thanks
    0
    Thanked 0 Times in 0 Posts

    option tag

    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

  • #2
    New Coder
    Join Date
    Apr 2003
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •