radio buttons value in lightning component -- w3web.net

How to display radio buttons horizontally and create tab from selected radio button value in Lightning Aura Components Salesforce | How to display radio button value in aura:component using JavaScript component controller Salesforce

400 views

Hey guys, today in this post we are going to learn about How to display radio buttons horizontally and create tab from selected radio button value in Lightning Aura Components Salesforce.

A ui:inputRadio component represents a radio button whose state is controlled by the value and disabled attributes. It’s rendered as an HTML input tag of type radio. To apply Lightning Design System styling, we recommend that you use lightning:radioGroup instead of ui:inputRadio.

To group your radio buttons together, specify the name attribute with a unique name. To know more details about ui:inputRadio, Click Here →.

 

Files we used to display radio buttons horizontally in aura:component →

CustomRadioButtonCmp.cmp Lightning Component It is used to display radio buttons horizontally in lightning component
CustomRadioButtonCmpController.js JavaScript Controller It is hold Javascript click function to show/hide container based on radio buttons value.
customRadioButtonApp.app Lightning Application It is used to call the component and preview on browser.

 

 

Final Output →

radio buttons value in lightning component -- w3web.net

 

Other related post that would you like to learn in Salesforce

 

  • Find the below steps ▾

 

Create Lightning Component →

Step 1:- Create Lightning Component : CustomRadioButtonCmp.cmp

From Developer Console >> File >> New >> Lightning Component

CustomRadioButtonCmp.cmp [Lightning Component File]

 

Create JavaScript Controller →

Step 2:- Create Lightning Component : CustomRadioButtonCmpController.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Controller

CustomRadioButtonCmpController.js [JavaScript Controller]

 

Create Lightning Application →

Step 3:- Create Lightning Application : customRadioButtonApp.app

From Developer Console >> File >> New >> Lightning Application

customRadioButtonApp.app [Component Application File]

 

Further post that would you like to learn in Salesforce

 


 

FAQ (Frequently Asked Questions)

What is button group in radio button?

A radio button group is a container control that holds radio buttons. The radio button group defines the layout for the buttons it contains, including a group title, text alignment for button labels, and whether or not to show a border. You can place a radio button group control within a section control.

How many radio buttons are in a group?

Only one radio button in a group can be selected at the same time. The radio group must have share the same name to be treated as a group.

How do you display output fields in lightning component?

Use the lightning-output-field component in lightning-record-view-form to display the value of a record field on a Salesforce object. Use the field-name attribute to specify the API field name.

Related Topics | You May Also Like

  • Your reaction of the article ▾
 

Hi, This is Vijay Kumar behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | | The Sitemap where you can find all published post on w3web.net

Leave a Comment