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

cfselect bound to query w/o initial value?

Explorer ,
Apr 03, 2010 Apr 03, 2010

Here's the code:

<cfinvoke component="Functions"

method="GetAllStewards"

returnVariable="AllStewards"

</cfinvoke>

<cfselect Name="NewSteward"

query="AllStewards"

display="FullName"

value="MemberID"

required="No"   

selected=" "

</cfselect>

Here's the problem:  The cfselect always "contains" the MemberID value for the first steward in the list.

Here's what I want:  If the values in the cfselect are not clicked, I want the value in NewSteward to be blank.  How do I do this?

2.2K
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

Community Expert , Apr 09, 2010 Apr 09, 2010

Introduce a blank option, then use the attribute queryPosition to position the items from the query relative to the blank option

<cfselect  Name="NewSteward"

query="AllStewards"

display="FullName"

value="MemberID"

required="No"

queryPosition="below">

<option value="your_default_value"></option>

</cfselect>

Translate
Community Expert ,
Apr 09, 2010 Apr 09, 2010
LATEST

Introduce a blank option, then use the attribute queryPosition to position the items from the query relative to the blank option

<cfselect  Name="NewSteward"

query="AllStewards"

display="FullName"

value="MemberID"

required="No"

queryPosition="below">

<option value="your_default_value"></option>

</cfselect>

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