Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFSELECT QUESTION

Participant ,
Nov 21, 2022 Nov 21, 2022

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>

 

299
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Nov 21, 2022 Nov 21, 2022
Translate
Participant ,
Nov 21, 2022 Nov 21, 2022

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 21, 2022 Nov 21, 2022
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2022 Nov 22, 2022
LATEST

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

queryPosition="below"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources