Select to view content in your preferred language

How to know the value of a RadioButton? (solved)

633
0
12-20-2010 08:50 AM
GeorgiannaStrode
Deactivated User
I had this typed up then found the answer!  So I'm posting it anyway in case someone else has the same issue.

-----
I'm trying to determine the value of a radio button in a form.  I know how to do this using an onClick method, but I have a form and want to know the value when the form is submitted. 

Here's what I have:

<fx:Declarations>
  <s:RadioButtonGroup id="yesNo" selectedValue="N">
</fx:Declarations>

then later:
<s:RadioButton groupName="yesNo"
id="N"
label="N"
value="N"  />
<s:RadioButton groupName="yesNo"
id="Y"
label="Y"
value="Y"  />


to see the value:

Alert.show(yesNo.selectedValue) works!! I had been trying yesNo.label, yesNo.value, yesNo.id but none of that worked.
Tags (2)
0 Kudos
0 Replies