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

    Batch Apex in Salesforce

    Using Batch Apex in Salesforce | The Developer Guide

    Blog in Salesforce Apex, Salesforce Training

    Batch Apex Batch Apex is used to process enormous amounts of data or we can say jobs e.g if we have thousands or millions of…

    API Call, Batch Apex, Batch Apex Class, Batch Apex Syntax, Batch Class
    Shweta Choudhary Oct 5, 2021
    4,874  Views

    5 Reasons Why You Should Say ‘YES’ to Salesforce Mobile App

    Blog in Salesforce

    If you’re in sales, you know how crucial the customer relationship management (CRM) platform is to move dealings through the pipeline. You may have been…

    Apptivo, Aura Components, B2B Marketing, Business, Business Process
    Softweb Dec 14, 2020
    3,041  Views

    Here's How Salesforce Promotes Collaboration through Interoperability

    Blog in Salesforce

    With problems like COVID-19 ransacking the world, have you ever wondered how governments had worked closely with other governments on a national and local level…

    Business, Charter, COVID-19, Decision Making, Faster Responses
    Apphienz Jan 3, 2022
    2,879  Views

    Popular Salesforce Videos

    How to Take Your Salesforce Support Model to the Next Level

    How to Take Your Salesforce Support Model to the Next Level

    Video in Salesforce Stories

    Jeremy Muldoon, the Salesforce expert at Rimini Street, discusses the Salesforce resource challenges faced by businesses today, how to overcome them, and how to take…

    Salesforce Training, Salesforce Tutorial, salesforce, salesforce platform, Salesforce Video
    Nauman Feb 11, 2022
    1,774  Views
    Installation & Configuration Process of Salesforce 9Calendar

    Installation & Configuration Process of Salesforce 9Calendar

    Video in AppExchange

    This video demonstrates the installation, configuration, and working of our latest Salesforce app 9Calendar. Watch this video till the end to understand its functionalities. Adding…

    Salesforce Tutorial, salesforce, App Builder, Salesforce Video, Salesforce VIdeos
    Tech9logy Sep 5, 2025
    89  Views
    How to Reference Custom Metadata Types to Optimize Salesforce Account Records Using Salesforce Flow

    How to Reference Custom Metadata Types to Optimize Salesforce Account Records Using Salesforce Flow

    Video in Salesforce Training

    Salesforce Account Region Allocation using Custom Metadata Types and Salesforce Flow This video walks through an example of how you can reference Custom metadata Types…

    Salesforce Training, salesforce, Salesforce Flow, Salesforce Video, Salesforce Learning
    Rupal Kakkar Jul 14, 2021
    1  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.