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
pinky1pinky1 

Show/ Hide Field on VF Page

Hi,

I have a requirement where i need to create a form of Custom Object (Computer__c) which has Lookup Realetionship to Account Object. On the form i need to show field's First name, Last name, Price and Account fields.

But on the form when First name, Last Name and Account fields are filled out and the selected Account, Brand Source (field on Account Object) value is WEB then only show Price field on the form otherwise Just Show First Name, Last Name and Account Fields on the Form and Crreat a Computer Record. 

Can anyone help me with the above requirement and help me with VF page and Controller class. Any help would be appreciated.
ShirishaShirisha (Salesforce Developers) 
Hi Pinky,

Greetings!

Can you please check the below documentation for the sample code and based on your requirement change the code to proceed.

https://salesforce.stackexchange.com/questions/224328/visualforce-display-and-hide-fields

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri