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
umesh1234umesh1234 

Checkbox option for drop down list in Visual force page?

Description:
  I have one Visualforce page in that I want to display values in Dropdown list and I want to select Multiple values either using Check box or using Control .How to do this
Rohit B ☁Rohit B ☁
Hi Sanvi,
There is an option named "multiselect". You can make it "true" for your purpose.
If you want to implement something custom then there are lots of jQuery components which you can utilize in your code.
Still you want something else please do let me know.
DeveloperDeveloper
Hi Sanvi,
try bello code
-------------------------------------------------------------------
public with sharing class dynamicpicklist {
        /**
         * Webkul Software.
         *
         * @category  Webkul
         * @author    Webkul
         * @copyright Copyright (c) 2010-2016 Webkul Software Private Limited (https://webkul.com)
         * @license   https://store.webkul.com/license.html
         */
 public dynamicpicklist()
    {
     
    }
 
    public List<SelectOption> getdynamiclist() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('INDIA','INDIA'));
        options.add(new SelectOption('US','US'));
        options.add(new SelectOption('BRAZIL','BRAZIL'));
        return options;
    }
 
}

VF PAGE:
----------------------------------------------------------
<apex:page controller="dynamicpicklist">
 
   <!--
        /**
         * Webkul Software.
         *
         * @category  Webkul
         * @author    Webkul
         * @copyright Copyright (c) 2010-2016 Webkul Software Private Limited (https://webkul.com)
         * @license   https://store.webkul.com/license.html
         */
         -->
 
  <apex:form >
      <apex:selectList size="1">
          <apex:selectOptions value="{!dynamiclist}"></apex:selectOptions>
      </apex:selectList>
  </apex:form>
 
</apex:page>
Rohit B ☁Rohit B ☁
Hi Sanvi,
Hope below link will resolve your concern :-
http://www.codexworld.com/multi-select-dropdown-list-with-checkbox-jquery/

If doesn't then please let me know.