function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Priyanka Reddy 74Priyanka Reddy 74 

how to pass selected multiple radio button values to controller

Hi All,

VF:
<apex:pageBlock>
<table>
<apex:repeat value="{!accList2}" var="a" >
<tr>
<apex:repeat value="{!a}" var="am">
<td> {!am.id} </td> 
<td> <input type="radio" name="radio1" id=""  value="{!am.name}"  onclick="test()" /> {!am.name}  </td>
<td> <input type="radio" name="radio2" id=""  value="{!am.phone}" onclick="test()" /> {!am.phone} </td>
</apex:repeat>   </tr>
</apex:repeat>
</table>
</apex:pageBlock>

Apex:
Public List<String> selectedFieldValues {get;set;}

accList2 =[select id,name,phone,billingcity from acount where id IN: idList];

User-added image
Basically I'm trying to get the selected radio button values to apex controller and store in List and then update account fields using visual force page similar to standard functionality.

Can someone please suggest me how to achieve this functionality usinf vf and apex.

Thank you,
Priyanaka.
 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Priyanka,

https://success.salesforce.com/answers?id=90630000000hU42AAE
https://salesforce.stackexchange.com/questions/49121/how-to-get-the-selected-radiobutton-value-in-apex

A similar query is answered in the above links.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.