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
apex_keenapex_keen 

showing dependent text box on selection from picklist

Hello!

In my requirement -there is a picklist  field with multiple values. One of the values is 'Others'. My requirement is when 'Others' Is selected, it should show a text box(another field). 

What is the easiest way to do this ? I guess, I've to write a new visual force page. and somehow have to get IDs of the fields. But what is not clear to me, how can I get picklist field values in visual force page. 

How can I use them for show/hide fields?

ValnavjoValnavjo

Hello apex_keen,

 

I recommend you to use jQuery. You can get the picklist using:

 

var my_picklist = j$('select[id$=my_picklist_id]');

 Play with jQuery a little bit and you will find the way to get the value of the picklist. Then use CSS to display or hide the text box.

 

 

Hope this helps,

 

JVN

MoggyMoggy