ここでは完全に間違っているかもしれませんが<cfif>
、ドロップダウン内で使用してドロップダウンのデフォルト値を動的に選択する方法はありますか?
私は次のことをしています:
<select class="field select" id="TimeWithXYZYears" name="TimeWithXYZYears" >
<option value="00" <cfif #thisInstance.responses.TimeWithXYZYears# eq 0>selected="selected"</cfif>>0</option>
<option value="01" <cfif #thisInstance.responses.TimeWithXYZYears# eq 1>selected="selected"</cfif>>1</option>
<option value="02" <cfif #thisInstance.responses.TimeWithXYZYears# eq 2>selected="selected"</cfif>>2</option>
<option value="03" <cfif #thisInstance.responses.TimeWithXYZYears# eq 3>selected="selected"</cfif>>3</option>
.
.
.
</select>
ページの前半で呼び出されたコンポーネント メソッドから既に値を取得していTimeWithXYZYears
ます。ページにダンプしようとしたところ、正しい値が返されました。
別の関数を書かずにこれを行う方法はありますか?