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
fiona gentryfiona gentry 

Based on checkbox I need to show/hide email and phone number

Dear pals,

I have a detailed page and i need to show / hide email and phone number, based on checkbox selection...how can i do that?

Your help is highly appreciated

Fiona
AbhishekAbhishek (Salesforce Developers) 
Fiona,

It can be possible through apex code.

Try the code snippet as mentioned in the below developer discussion,
https://salesforce.stackexchange.com/questions/283568/visualforce-show-hide-input-field-based-on-selection-of-one-selectoption-in-sel


For further reference check the below,
https://developer.salesforce.com/forums/?id=906F000000098d4IAA


If it helps mark this as the best answer.


Thanks.
ShirishaShirisha (Salesforce Developers) 
Hi Fiona,

Greetings!

Please refer the sample code in the below thread to show/hide multiple fields based on the picklist value:

https://salesforce.stackexchange.com/questions/101208/how-to-hide-show-the-fields-based-on-picklist-value

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri