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
Puja khetanPuja khetan 

dynamic visual force page

i have to develop one site where i have to give choices to users like if user choose yes then 5 fields get displayed and if user sepects No then seprate 7 fields get displayed .

i have plan to develop this site on salesforce using visualforce page and host there only ,
can some one help if i it cpossible to make choices like that on visual force page ?
 
Best Answer chosen by Puja khetan
ShirishaShirisha (Salesforce Developers) 
Hi Puja,

Greetings!

Please find the sample code below:
 
<apex:page standardController="Account">

<apex:form id="theForm">

  <apex:inputfield value="{!Account.Active__c}">
    <apex:actionSupport event="onchange" reRender="theForm" />
</apex:inputField>

  <apex:inputField value="{!Account.AA2__c}" rendered="{!Account.Active__c== 'Yes'}" />
  <apex:inputField value="{!Account.AA1__c}" rendered="{! Account.Active__c!= 'No'}" />

</apex:form>

</apex:page>
You can include all the fields based on the logic.

For more information check here:
https://success.salesforce.com/ideaView?id=08730000000IaIq
https://developer.salesforce.com/forums/?id=906F000000098qrIAA


Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri