12
votes
Accepted
lightning:radioGroup is allowing multi-select
You've forgotten a required attribute. The radioGroup is grounded in HTML's <input type="radio" />, which uses a "name" attribute to determine groups. If you forget to specify the name, the ...
9
votes
How to setup help text for radio button with onmousehover
While creating the SelectOption for the apex:selectRadio you can pass the HelpText as HTML string as title in the label parameter with this constructor SelectOption(value, label) of SelectOption Apex ...
8
votes
Accepted
Can't get data from lightning:radioGroup
Try this
Component:
<aura:component>
<aura:attribute name="options" type="List" default="[
{'label': 'Option1', 'value': '1'},
{'label': 'Option2', 'value': '2'}
]"/&...
7
votes
Accepted
Why all selected radio buttons are reset when another is selected?
Radio buttons are checked based on the uniqueness of the name attribute. Set different names for each section and you'll be fine.
For example like this
<div key={task.Id}>
<lightning-...
6
votes
Accepted
LWC update toggle checked/unchecked attribute from JS
Just bind the checked attribute to javascript property.
<lightning-input data-id="toggle2" type="toggle" label="TOGGLE2" checked={checked} message-toggle-active="" message-toggle-inactive="">&...
6
votes
How to add a radio button in lwc datatable?
Using: <lightning-dattable max-row-selection="1">
According to the lwc datatable documentation: Radio buttons are used when maxRowSelection is 1.
4
votes
Labeling radio Options in visualforce
Use the itemLabel attribute on apex:selectOption:
<apex:selectRadio label="Update Existing Contact" value="{!createOrUpdateSite}">
<apex:selectOption
itemValue="Update Existing Contact"...
3
votes
Accepted
Select only one radio button in a Visualforce page
Your radio button needs a name. All radio buttons with the same name behave as a group, of which only one can be selected.
<input type="radio" name="checkboxGroup" value="{!...
3
votes
Accepted
Radio Button is not working when using same component twice on same page in lightning
The name is supposed to link all radio group items together. This is standard HTML behavior. Since the name is always the same, the browser thinks these inputs all belong to the same "group."
Instead,...
3
votes
Accepted
Radio Button within Iteration - When user selects radiobutton, store the associated sourceId in attribute 'accountId'
component
<aura:component>
<aura:attribute name="options1" type="List" default="['1','2','3']"/>
<aura:attribute name="options" type="List" default="[{'label': '', 'value': '...
3
votes
Accepted
Why does <lightning:radioGroup returns String rather than Boolean
Because the HTML specification says that "value" is a "String." You need to convert it to a Boolean value if you want it as a Boolean. I know it's kind of a silly rule, but you have to remember that ...
3
votes
Accepted
Lightning Web Components - Radio button "checked" not retaining when navigating back and forth
You have to bind the checked attribute of the radio group to your data (e. g. via adding a checked property to your options object) in order to keep track of the selected dom element.
Updated your ...
3
votes
Accepted
Lightning radio selector in iteration disappears when option selected in another row
You need a unique name for each group:
<lightning:radioGroup name="{!'triggerType'+index}"
variant="label-hidden"
options="{!v.triggerTypeOptions}"
...
3
votes
Can't get data from lightning:radioGroup
Add value attribute to the radioGroup component and bind it some attribute or sObject field.
<aura:component>
<aura:attribute name="value" type="string" default=""/>
<aura:...
3
votes
Accepted
Lightning radio button NOT getting the correct value (or modifying it)?
Well, after spending few extra hours than usual, I was able to fix it.
The problem with my code lies within the document.querySelector. As per my <input type="radio" implementation, I do not need ...
3
votes
Accepted
SelectRadio how to display radio buttons side by side
Presumably this is the part that matters:
<apex:selectRadio styleClass="radioOpt" value="{!selectedRT}" id="outMailshot_Frequency__c">
<apex:selectOption itemValue="INCOME" itemLabel=" ...
3
votes
Accepted
How can I get the value of the selected radio button?
id attributes are usually changed in lightning. You can use another attribute probably accessKey or any other data-attribute that could tell you which row was actually checked.
You can maintain it as ...
2
votes
Displaying Picklist as radiobutton on VF
You can change the dropdown to radio buttons with JavaScript also. First hide the dropdown, then take the data out of the elements and create the <input type="radio"/><label/><br/> ...
2
votes
How to disable Radio Buttons (fetched from a Picklist Field) on a Visualforce page?
One solution is to use isDisabled property of SelectOption class. Check the SelectOption Constructors detail page, there is a constructor which can take 3 arguments (value, label, isDisabled). So if ...
2
votes
Accepted
Close and reopen VF page
Theoretically you should just need a refresh no? Commit the template value to your record, refresh the page, requery the record, and render the template. Get rid of the re-render altogether and it ...
2
votes
Accepted
Issue with Radio Button with text input
I was able to finally sort out where the on, was coming from, there were two problems with the form.
The form was referencing "Amount" twice in the last line, once in the radio button and once in the ...
2
votes
AMPscript for Radio Button with text input
Considering you need this for the form that creates an opportunity mentioned in your previous question, you can use the following:
<script runat="server">
Platform.Load("Core","1.1.1");
try{...
2
votes
How to check the appropriate radio button based on its value
You should use apex:selectRadio for your use case as below
<!-- Page: -->
<apex:page controller="FeedbackCtrl">
<apex:form>
<apex:selectRadio value="{!rating}">
...
2
votes
Accepted
Labels not showing on radio button inside a Flow (called by lightning component)
Just an idea, did you check that the actual text it's not there? Inspect in the browser. May be some CSS is affecting the text and making it white, so it is there but you can't see it.
2
votes
Accepted
Radio button requires two clicks to "check" even though conditional template renders
Instead of adding a checked attribute to the first input radio, bind it with the input property as:
<input
onchange={handleRadioChange}
type="radio"
data-id="option-1&...
2
votes
unable to set the first record as selected in html table
If you want to use the radio button, use lightning-radio-group or <input type="radio">. Currently, you are using the checkbox. The main difference is that for a radio group with the ...
2
votes
Accepted
Why does the radio button has checked = false , but is selected on screen?
tl;dr
Your usage of the "checked" and "disabled" attributes is incorrect
The longer version
In HTML, the "checked" attribute is used to set the default/initial value of a ...
1
vote
Accepted
LWC Modal on Radio 'onchange' event does not retain the checked value
There are a couple of issues in your code,
You have an assignment in renderedCallback causing unnecessary overrides each time the template is re-rendered by a reactivity change.
You do not have ...
1
vote
Accepted
how to copy values to field in aura:iteration dynamically using Radio button with multiple rows
i achieved by using onclick event on child tr instead radio button. i used HTML data-attribute to bind parent row index and child row index, so i got both indexes when ever click on any child row ...
1
vote
Accepted
Facing problem in single select radio button?
Use Input Tag for Radio Button as shown below and no need to use Script.. it can be done by Apex Controller itself
<td>
<input name="isRadio" type="radio" value="{!rep.ocr.Contact.Id}" ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
radio-button × 84visualforce × 35
lightning-aura-components × 15
lightning-web-components × 14
apex × 12
lightning × 11
javascript × 10
selectradio × 6
pageblocktable × 5
aura × 4
selectoption × 4
visual-workflow × 3
table × 3
lightninginput × 3
aura-iteration × 3
lightning-radiogroup × 3
marketing-cloud × 2
ampscript × 2
lightning-experience × 2
picklist × 2
html × 2
record-type × 2
lightning-datatable × 2
controller-extension × 2
event × 2