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
VDid.ax1020VDid.ax1020 

Visualforce refrencing Apex Class - convert radio button to multi select radio button

I have a VF Page that refrences an APEX Class to get a list of picklist values for a survey question. How can I convert the below code so that the fields are now multi select radio button (Multiple choices can be picked) as opposed to a regular radio button

 

  public List<SelectOption> getInterestOptions(){
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('Virtual Phone System','Virtual Phone System'));
        options.add(new SelectOption('Online Data Backup','Online Data Backup'));
    options.add(new SelectOption('Hosted Email','Hosted Email'));
    options.add(new SelectOption('Email Marketing','Email Marketing'));
        return options;

 

Thank you in advance,

V

raseshtcsraseshtcs

You can convert the picklist to mutliselect picklist by adding the multiselect= true. This would make the picklist a mutilselect, but i dont know if you can convert it to multiselect radio buttons.

 

 <apex:selectList value="{!countries}" multiselect="true">
tomcollinstomcollins

Part of what defines a radio button is that you can only select one from a group of options.

 

You could possibly display your picklist as a series of checkboxes, by using apex:repeat to loop through an array of options.