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
ThathulaThathula 

How to make an input field required dynamically..

hi all,

I have a check box and below that check bow i've a pageblock section with several input fields..  I need to make those input fields as required fields if i check the above mentioned check box..

How can i do that??

Thanks a lot 
Really appreicaite you responds..
NehalNehal (Salesforce Developers) 
Hi,

Please refer to links below that will guide you on how to make input field required dynamically:

1.https://success.salesforce.com/ideaView?id=08730000000GyzBAAS
2.https://developer.salesforce.com/forums/ForumsMain?id=906F00000008y1ZIAQ
3.http://salesforce.stackexchange.com/questions/22213/how-can-i-dynamically-render-required-fields-using-a-dynamic-component
4.http://salesforce.stackexchange.com/questions/21741/how-can-i-build-a-complex-visualforce-dynamic-binding-dynamically
5.http://www.infallibletechie.com/2012/10/dynamically-making-field-required-using.html
6.http://www.infallibletechie.com/2012/10/dynamically-making-field-read-only.html
7.http://stackoverflow.com/questions/19834815/creat-dynamic-form-in-visualforce

I hope this helps.
SANKAR NSANKAR N
Hi,

Just try with "required" attribute in inputfield like <apex:inputfield required={! if(checkbox =0 , true ,false)}  this exaple you have made some changes depends on your requirement.

regards,
Sankar
Jason OrbisonJason Orbison
@Sankar N, I am a newbie. I was wondering how I can use apex to control the required atttributes of a field.