Hello Everyone. I want to create a lightning component where i will have 3 radio buttons , now i want to store the selected values of radio buttons and show them on to the submit click. Please help me out
Hi Sir Praveen , I thank you for the help , but actually this way is ok for having 2 or 3 radio buttons but what i actually want is that i have atleast 12 radio buttons , i want that the selected values should be stored into a single attribute so that i can iterate over onto it to show results. Further help would be most appreciated. Thanks
But Once again i would like to clarify the requirement . Here it is --> { I have 10 radio groups each of them have 3 options of 'YES' / 'NO' / 'DONT KNOW' , now what i want is when we done selecting the options for all 10 , each of those result values needs to be stored into a single attribute so that i can iterate over that attribute for further requirement }
The above code is absolutely fine just need one thing like [ getValue1 , getValue2 ] these both value i need to store into an LIST = Type attribute of aura component
try below modified code. I hope this time it would be as your expectations.
don't forget to mark it as best answer.
Thank you
All Answers
The code can be written as below .
Component file
JS File:
I did not include any styling for the component. This is just an idea of the component.
If this solution helps, Please mark it as best answer.
Thanks,
I think you need to use lightning:radioGroup for achieve your requirment.
here is sample example you can get ref. from it.
don't forget to mark it as best answer if it helps you so that it can help to others in future.
Thank you
But Once again i would like to clarify the requirement . Here it is --> { I have 10 radio groups each of them have 3 options of 'YES' / 'NO' / 'DONT KNOW' , now what i want is when we done selecting the options for all 10 , each of those result values needs to be stored into a single attribute so that i can iterate over that attribute for further requirement }
The above code is absolutely fine just need one thing like [ getValue1 , getValue2 ] these both value i need to store into an LIST = Type attribute of aura component
try below modified code. I hope this time it would be as your expectations.
don't forget to mark it as best answer.
Thank you