Skip to main content
Inspiring
Nov 21, 2022 4:59 PM UTC
Answered

CFSELECT QUESTION

When using htmal select tag I can show a message on the first option attribute to the user, such as: Please select a country :

<fieldset>
<select name="Countries" class="stylebox" id="Country" required>
     <option value="">Select your Country</option>   
    <CFOUTPUT QUERY="GetCountries">
    <option value="#GetCountries.country#">#GetCountries.country#</option>
    </CFOUTPUT>
</select>
</fieldset>

 

Is it possible to do the same thing with cfselect and how? I put down my message in the message attribute of cfselect but it doesn't work. Here is my code:

<fieldset>
<cfselect name="Countries" query="GetCountries" value="Country" required="True" multiple="No" size="1" class="stylebox" ></cfselect>
</fieldset>

 

    This topic is closed to new replies. Start a new post to keep the conversation going.
    mega_LCorrect answer
    Inspiring
    Nov 21, 2022 9:54 PM UTC

    3 replies

    mega_LAuthor
    Inspiring
    Nov 21, 2022 9:39 PM UTC

    I tried adding 

    <cfselect name="Countries" query="GetCountries" value="Country" required="True" multiple="No" size="1" class="stylebox" >

        <option value = "">Select your country</option>

    </cfselect>

     

    It works but this appear on the bottom most of the list where user don't see it immediately. How to get this option listed on top. 

    Translate
    mega_LAuthorCorrect answer
    Inspiring
    Nov 21, 2022 9:54 PM UTC
    BKBK
    Community Expert
    Community Expert
    Nov 22, 2022 10:57 AM UTC

    Let me confirm the answer, to assist anyone who comes here with the same question. Just add the cfselect attribute,  

    queryPosition="below"
    Translate