Question
Get selected value of cfselect
Hi. What I want to do should be simple, but it's killing me!
All I want to do is display the selected value of a cfselect on my
page. Here's the code:
Select:
<cfselect name="ddlStates" value="fullname" display="fullname" width="200"
style="font-size:11px"
bind="cfc:cfc.nationwideJobs.getStates()"
bindonload="true">
</cfselect>
<cfset var1 = #form.ddlStates.selectedItem.label#>
<cfoutput>#var1#</cfoutput>
This doesn't work. The error I keep getting is:
Error Occurred While Processing Request
Element DDLSTATES.SELECTEDITEM.LABEL is undefined in FORM.
Thanks for the help.
Select:
<cfselect name="ddlStates" value="fullname" display="fullname" width="200"
style="font-size:11px"
bind="cfc:cfc.nationwideJobs.getStates()"
bindonload="true">
</cfselect>
<cfset var1 = #form.ddlStates.selectedItem.label#>
<cfoutput>#var1#</cfoutput>
This doesn't work. The error I keep getting is:
Error Occurred While Processing Request
Element DDLSTATES.SELECTEDITEM.LABEL is undefined in FORM.
Thanks for the help.
