Here's the scenario. I have a form, it finds an error and sends them back to the original form with an error message that says fix the error. How do I repopulate a CFSELECT with the choice they made before the error?
I'm using session variables to repopulate input boxes, radio buttons, etc. but can't get the select drop down boxes to work. I don't want them to have to fill out the form again if they only have one little problem. Thanks.
Here's the code I have which is WRONG! Basically, if it's not defined query the database and give them the list, otherwise give it the value they had before the error.
<CFOUTPUT>
<CFIF IsDefined("session.AssignTo"
>
<CFIF session.AssignTo IS NOT "">
<cfselect name="AssignTo"
size="1"
message="Please select a name"
query="gethelp"
required="Yes"
value="#session.AssignTo#">
</cfselect>
</CFIF>
<CFELSE>
<cfselect name="AssignTo"
size="1"
message="Please select a name"
query="gethelp"
required="Yes"
value="StaffName">
</cfselect>
</CFIF>
</CFOUTPUT>
Sherylj
I'm using session variables to repopulate input boxes, radio buttons, etc. but can't get the select drop down boxes to work. I don't want them to have to fill out the form again if they only have one little problem. Thanks.
Here's the code I have which is WRONG! Basically, if it's not defined query the database and give them the list, otherwise give it the value they had before the error.
<CFOUTPUT>
<CFIF IsDefined("session.AssignTo"
<CFIF session.AssignTo IS NOT "">
<cfselect name="AssignTo"
size="1"
message="Please select a name"
query="gethelp"
required="Yes"
value="#session.AssignTo#">
</cfselect>
</CFIF>
<CFELSE>
<cfselect name="AssignTo"
size="1"
message="Please select a name"
query="gethelp"
required="Yes"
value="StaffName">
</cfselect>
</CFIF>
</CFOUTPUT>
Sherylj