+ Start a Discussion
Sachin Bhalerao 17Sachin Bhalerao 17 

How to capture selected value of group radio button in lightning component ?

Dear Team ,

Greetings !!!

Please let me know how to  capture selected value of group radio button in lightning component . My code are as follows when m debugging my code it picks both value not selected one .
Component

<aura:component >
	 <aura:attribute name="options" type="List" default="[

       {'label': 'Agent', 'value': 'Agent'},
       {'label': 'Agency', 'value': 'Agency'},
       ]"/>


  <aura:attribute name="optionChoosenRadio" type="String" default=""/>




 <div class = "slds-col slds-size--2-of-2 " style="display: inline;">
 <lightning:radioGroup name="radioGroup"
    label="Choose Option"
    variant="label-inline"
    options="{!v.options }"
    value="{!v.optionChoosenRadio }"
    type="radio"
    required="true" onchange="{!c.handleChange}"  />
</div>


</aura:component>


Controller.js

({
	handleChange : function(component, event, helper) {
		//alert('hello');
		var a = component.get('v.options');
        
	}
})

Thanks & Regards
Sachin Bhalerao​​​​​​​
Sachin Bhalerao 17Sachin Bhalerao 17
var b = component.get('v.optionChoosenRadio');