I have displayed radio buttons on vf page using wrapper class. I want to group these radio buttons. I want to be able to select one radio button from each group. Can someone help me. Here if i select one radio button the other gets deselected.

  <apex:pageBlockTable style="border:1px solid black;font-size:15px;font-family:Arial, Helvetica, sans-serif" value="{!properties}" var="prop">
         <apex:column headerValue="Select">

         <apex:pageBlockTable value="{!prop.prolist}" var="a">

        <apex:column >
       <input type = "radio" name = "test" id = "test" value="{!prop.selected}" /> 

In HTML, the unique radio click is handled using the radio button names.

If you want to be able to click on multiple radio buttons, these radio buttons must not have the same name.

I suggest you to use a variable dedicated to the radio name in your wrapper class (for example RadioName as String) and use this variable in your VF page like this:

<input type="radio" name="{!prop.radioName}" value="{!prop.selected}" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.