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
Charlie Cox 1Charlie Cox 1 

Radio Buttons in a repeat.

I want a user to be able to select either Rice or Texas, Then in the next row be able to select Navy or Army. Basically I want a user to have 1 radio button per row.
User-added image
RIght now I am only able to select Navy or Army or Texas or Rice. (I can only pick 1 of the 4 instead of 1 of each 2.)

<apex:repeat var="a" value="{!picks}">
        <input type="radio" class="radio" name="x" value="{!a.homeTeamSelected}" id="y" />
        <label for="y">{!a.homeTeamName}</label>
        <input type="radio" class="radio" name="x" value="{!a.awayTeamSelected}" id="z" />
        <label for="z">{!a.awayTeamName}</label> <br/>  <hr/>  
    </apex:repeat>

Here is the section of my VF page. I have looked around and previous solutions have not worked for me so any new input would be great!

Thanks!
David ZhuDavid Zhu
I also have problem with grouping input component. I can only implement this using selectradio. 
 
public class MyBooks
{
    
    public Pick pick {get;set;}
    
    public string Home {get;set;}    

    public MyBooks()
    {
        Pick = new Pick();
        Pick.hometeam.Add(New selectOption('Texas','Texas'));
        Pick.hometeam.Add(New selectOption('Rice','Rice'));
        Pick.awayteam.Add(New selectOption('Navy','Navy'));
        Pick.awayteam.Add(New selectOption('Army','Army'));
        

    }

    public class Pick
    {
        public list<selectOption> homeTeam {get;set;}
        public list<selectOption> awayteam {get;set;}
        
        public pick()
        {
            hometeam = new list<selectOption>();
            awayteam = new list<selectOption>();
        }
    }
}
 
<apex:page controller="MyBooks">
    <apex:form >

  <apex:selectradio value="{!home}">
      <apex:selectOptions value="{!Pick.hometeam}"/>
  </apex:selectradio>
  <hr/>

  <apex:selectradio value="{!home}">
      <apex:selectOptions value="{!pick.awayteam}"/>
  </apex:selectradio>
  <hr/>


  </apex:form>
  
</apex:page>