> If you want to pass "yes" to the action page, you should use
> value="yes" with checked. If you want to pass "5" the following
> is correct.
>
> <CFINPUT TYPE="RADIO" NAME="Part3_2" VALUE="5" CHECKED>?
This isn't correct. If you want the field to be checked by default, then you
should add the word CHECKED, as in the above example. If the user submits
the form with the field checked, the action page will receive the variable
"Part3_2" with the value "5", not the value "yes".
> Only fields that are checked will be passed, so on the action
> page, if you want to check if something has been passed, just
> check to see if the form field isdefined:
>
> <cfif isdefined("form.part3_2")>
> The field was checked.
> </cfif>
If you want to pass any value at all to the action page for a checkbox or
radio button, the field must be checked when the form is submitted. If the
field is unchecked, there won't be a corresponding variable in the action
page.
However, radio buttons are typically used in groups (or arrays, if you will)
of fields with the same name and different values. So, as long as one of
them is checked when the page is loaded, if the user checks another, they
will uncheck the first one, and there will be a corresponding variable in
the action page, although it might not correspond with the field that was
originally checked when the form was first loaded. For example, in the code
below, the default Stooge is Curly, but no matter what the user does, one
Stooge will be submitted.
<INPUT TYPE="radio" NAME="FavoriteStooge" VALUE="Larry"> Larry
<INPUT TYPE="radio" NAME="FavoriteStooge" VALUE="Moe"> Moe
<INPUT TYPE="radio" NAME="FavoriteStooge" VALUE="Curly" CHECKED> Curly
<INPUT TYPE="radio" NAME="FavoriteStooge" VALUE="Shemp"> Shemp
I hope you find this helpful.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.