Activity Forums Salesforce® Discussions Which tag is used with both radio buttons and picklists to create the selectable values?

  • Which tag is used with both radio buttons and picklists to create the selectable values?

    Posted by Anjali on September 13, 2018 at 1:10 pm

    Which tag is used with both radio buttons and picklists to create the selectable values?

    Pooja replied 4 years, 10 months ago 5 Members · 4 Replies
  • 4 Replies
  • Parul

    Member
    September 13, 2018 at 1:30 pm

    Using this tag you can used with both radio buttons and picklists to create the selectable values <apex:selectOption> 

     

    Thanks

  • madhulika shah

    Member
    September 13, 2018 at 1:33 pm

    Hi Anjali,

    <apex:selectOption> tag is used with both radio buttons and picklists to create the selectable values.

    Thanks.

  • shariq

    Member
    September 14, 2018 at 1:21 am

    Hi,

    You need to use apex:selectoption for your requirement.

    <apex:page controller="chooseColor">
    <apex:form>
    <apex:selectList id="chooseColor" value="{!string}" size="1">
    <apex:selectOption itemValue="red" itemLabel="Red"/>
    <apex:selectOption itemValue="white" itemLabel="White"/>
    <apex:selectOption itemValue="blue" itemLabel="Blue"/>
    </apex:selectList>
    </apex:form>
    </apex:page>

    controller -

    public class chooseColor {
    String s = 'blue';

    public String getString() {
    return s;
    }

    public void setString(String s) {
    this.s = s;
    }
    }

    Hope this helps.

  • Pooja

    Member
    February 4, 2020 at 2:11 pm

    This tag is used with both radio buttons and picklist values-

    <apex:selectOption>

Log In to reply.

Popular Salesforce Blogs