Reply
Regular Contributor
apex_keen
Posts: 104
0

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?

Regular Contributor
Valnavjo
Posts: 11
0

Re: showing dependent text box on selection from picklist

[ Edited ]

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

Regular Contributor
Moggy
Posts: 27
0

Re: showing dependent text box on selection from picklist

look here http://boards.developerforce.com/t5/Visualforce-Development/Conditionally-hide-field-on-page-layout/...

for a sample to show/hide fields ( the rendered statement)

Not everything that counts can be counted,
and not everything that can be counted counts.
@Albert Einstein