Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How can show input text as pick-list depends on the another pick-list value in salesforce?

    Tagged: Account, Picklist, Salesforce Custom Field, Salesforce Development, Salesforce Visualforce, Salesforce Visualforce Page, Text Field

    • Salesforce® Discussions

      How can show input text as pick-list depends on the another pick-list value in salesforce?

      Posted by NAVEEN on January 18, 2017 at 9:54 AM

      I have one pick-list fields with Account fields and one Input Text field on Vf page, My requirement is when i select industry in pick list then Input Text field has to shown pick list values of Industry? how can I achieve this?

      Kumar replied 8 years, 12 months ago 2 Members · 1 Reply
      • Account
      • Picklist
      • Salesforce Custom Field
      • Salesforce Development
      • Salesforce Visualforce
      • Salesforce Visualforce Page
      • Text Field
    • 1 Reply
    • Kumar

      Member
      January 23, 2017 at 7:37 AM

      Hi Naveen,

      Here is an example with countries and states. First, define your Visulforce Page with the picklists.
      You can see that it uses a custom controller and an event "onchange" on country list to change the content of the states list when you select a country.

      Here is the code:

      <apex:page controller="ctlDepPickLst">
      <apex:form >
      <apex:pageBlock>
      <apex:pageBlockSection columns="2">
      <apex:pageblockSectionItem>
      <apex:outputLabel value="Country"/>
      </apex:pageblockSectionItem>
      <apex:pageblockSectionItem>
      <apex:selectList size="1" value="{!country}">
      <apex:selectOptions value="{!countries}"/>
      <apex:actionSupport event="onchange" reRender="a"/>
      </apex:selectList>
      </apex:pageblockSectionItem>
      <apex:pageblockSectionItem>
      <apex:outputLabel value="State"/>
      </apex:pageblockSectionItem>
      <apex:pageblockSectionItem>
      <apex:selectList size="1" value="{!state}" id="a">
      <apex:selectOptions value="{!states}"/>
      </apex:selectList>
      </apex:pageblockSectionItem>
      </apex:pageBlockSection>
      </apex:pageBlock>
      </apex:form>
      </apex:page>

      Here is the custom controller:

      public class ctlDepPickLst {
      public String country {get;set;}
      public String state {get;set;}

      public List<SelectOption> getCountries()
      {
      List<SelectOption> options = new List<SelectOption>();
      options.add(new SelectOption('None','--- Select ---'));
      options.add(new SelectOption('US','United States'));
      options.add(new SelectOption('IN','India'));
      return options;
      }

      public List<SelectOption> getStates()
      {
      List<SelectOption> options = new List<SelectOption>();
      if(country == 'US')
      {
      options.add(new SelectOption('CO','Colorado'));
      options.add(new SelectOption('NE','Nevada'));
      options.add(new SelectOption('TE','Texas'));
      }
      else if(country == 'IN')
      {
      options.add(new SelectOption('BI','Bihar'));
      options.add(new SelectOption('KE','Kerala'));
      options.add(new SelectOption('MA','Manipur'));
      }
      else
      {
      options.add(new SelectOption('None','--- Select ---'));
      }
      return options;
      }
      }

      Hope this helps.

      • This reply was modified 8 years, 12 months ago by  Kumar.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Difference between a Salesforce Admin & Developer

    Blog in Salesforce Admin

    In the fast paced world of customer relationship management (CRM) Salesforce stands as a robust platform. Its robust platform empowers organizations to manage relationships &…

    Difference, Salesforce Admin, salesforcedeveloper
    Eden Aug 1, 2025
    131  Views
    Salesforce For Business

    Top 7 Reasons To Choose Salesforce For Your Business

    Blog in Salesforce

    Description: Salesforce is one of the world leaders in the development of cloud-based CRM solutions. We'll talk about why it is important for your business.…

    Applications, Automated Scripts, Best Solutions, Business, Business Requirements
    Theresa Cofield Mar 23, 2021
    4,137  Views

    Salesforce Lightning Web Components Developer Guide: Chapter 1

    Blog in Lightning

    We are starting the Lightning Web Components developer guide, a series of articles dedicated to LWC (Lightning Web Components). We will understand the structure and…

    API, Automation, ButtonStyle, Class-level Array, Class-level Variables
    Sparkybit Dec 8, 2023
    1,988  Views

    Popular Salesforce Videos

    Top 6 Products by Salesforce Marketing Cloud

    Top 6 Products by Salesforce Marketing Cloud

    Video in Marketing, Salesforce Cloud Platform

    Salesforce is largely regarded as the most influential Salesforce automation and cloud CRM vendor, having popularized the SaaS model and, in the process, disrupted the…

    salesforce, Salesforce Marketing Cloud, Salesforce Automation, Salesforce Video, Cloud CRM Vendor
    Algoworks Feb 4, 2021
    1,613  Views
    Salesforce To RDS Integration Through Dell Boomi | Salesforce Tutorial

    Salesforce To RDS Integration Through Dell Boomi | Salesforce Tutorial

    Video in Salesforce Integration, Salesforce Training

    Salesforce to RDS integration through Dell Boomi. This tutorial will cover the following points - 1. Introduction Take a quick glimpse at integrating accounts from…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Dell Boomi
    Algoworks Dec 23, 2020
    2,925  Views
    What All Industries Are Covered By Salesforce Industries?

    What All Industries Are Covered By Salesforce Industries?

    Video in Salesforce Stories, Salesforce Cloud Platform

    Salesforce Industries offers a collection of 12 industry clouds that are suited to the best practices for these sectors. Salesforce Industries aids businesses in navigating…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Webinar, Salesforce clouds
    Cyntexa Sep 20, 2022
    1,421  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.