I have radio buttons for gender. When the form is submitted, the value is
entered into a db column 1 or 2:
<cfinput name="g" id="g" type="radio" value="1" required="yes"
/> F<cfinput name="g" id="g" type="radio" value="2" />
I want to check one by default depending on the value stored in the db column
when the form loads.
I'm able to use a CFIF statement to check one by default in the HTML radio
like:
<cfif rs.g eq 1>checked="true"</cfif>
but you're not allowed to have cfif in a single cfinput tag.
How do I do it.
Define a var checkedStatus (or similar), set the value to
'checked="true"' or empty string depending in your if statement
and use <cfinput name="g" id="g" type="radio" value="2"
#checkedStatus# />
--
Dan Bracuk