+ 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,


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 value="{!Account.AA2__c}" rendered="{!Account.Active__c== 'Yes'}" />
  <apex:inputField value="{!Account.AA1__c}" rendered="{! Account.Active__c!= 'No'}" />


You can include all the fields based on the logic.

For more information check here:

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

Warm Regards,
Shirisha Pathuri