Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all articles
Browse latest Browse all 5979

Using CFIF in CFINPUT radio tag

$
0
0
I'm a little new to using cfinput. I always use HTML input.

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.

Viewing all articles
Browse latest Browse all 5979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>