Copy link to clipboard
Copied
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>
Found the answer:
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Found the answer:
Copy link to clipboard
Copied
Let me confirm the answer, to assist anyone who comes here with the same question. Just add the cfselect attribute,
queryPosition="below"