Answered
Assign Session Variables to Radio Buttons
Sorry if this may have been partially answered in another
post, but I can seem to find the answer.
I have a form that contains radio buttons, along with other form fields. If the user hits the submit button, it takes them to a processing page which has alot of validation checks, spits an error message out to the user, and displays a 'go back' button to return to the previous page for corrections.
All of my text input boxes have session variables assigned to the 'value' field and they all work great. After the user hits the go back button, the data is re-populated back in the fields. However, I cannot figure out how to assign a session variable to my radio buttons. Here is my code:
<cfinput required="yes" message="You must Indicate Y or N for timeframe - work during C-Check" type="radio" value="YES" name="ccheck">YES
<cfinput required="yes" message="You must Indicate Y or N for timeframe - work during C-Check" type="radio" value="NO" name="ccheck">NO
You can see that unlike text boxes, the value field is already populated, so I am confused as to where to add the session variable. Here is what my text input field looks like:
<cfinput type="text" name="ccheck_total" size="8" validate="integer" message="The Total Aircraft field can only contain numbers." value="#session.ccheck_total#">
I'm fairly sure I will need an <cfif> statement on my processing page, but am confused how to code it. Please assist.
I have a form that contains radio buttons, along with other form fields. If the user hits the submit button, it takes them to a processing page which has alot of validation checks, spits an error message out to the user, and displays a 'go back' button to return to the previous page for corrections.
All of my text input boxes have session variables assigned to the 'value' field and they all work great. After the user hits the go back button, the data is re-populated back in the fields. However, I cannot figure out how to assign a session variable to my radio buttons. Here is my code:
<cfinput required="yes" message="You must Indicate Y or N for timeframe - work during C-Check" type="radio" value="YES" name="ccheck">YES
<cfinput required="yes" message="You must Indicate Y or N for timeframe - work during C-Check" type="radio" value="NO" name="ccheck">NO
You can see that unlike text boxes, the value field is already populated, so I am confused as to where to add the session variable. Here is what my text input field looks like:
<cfinput type="text" name="ccheck_total" size="8" validate="integer" message="The Total Aircraft field can only contain numbers." value="#session.ccheck_total#">
I'm fairly sure I will need an <cfif> statement on my processing page, but am confused how to code it. Please assist.
