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
chanti kchanti k 

i want remove required for filed while selecting two fields in visualforce page

HI ,


I have 3 fields, one is required field (Product__c)have in one pageblock section section and one more section i have two fileds, such as(Type__c= Mechanic and seviarty__c=Admin.).

When ever i can set  for those fileds then now i want remove required for (Product__c) this filed.

Can you please sugggested me, with example code in apex class .

Thank you,
Chanti

 
akschampakschamp
You can remove required attribue from Visualforce tag itself, you can use inline If condition to set Required = true or false.

Required = "{!If(Condition, true,false)}"