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 display the 3 fields whenever select the pick list value in visualforce page?

Hi All,

i want display the 3 fields whenever select the value of picklist in visualforce page? how to w e can achive this.

Example with code..this is very helpfull for me.
pls help me..
 
Waqar Hussain SFWaqar Hussain SF
<apex:form id="thefrm" />
<apex:selectList styleClass="slds-input" value="{!PaymentType}" size="1">
		<apex:selectOptions value="{!PaymentTypes}"/>
		<apex:actionSupport event="onchange" rerender="thefrm"/>
	</apex:selectList>
	
	<apex:outputpanel rendered="{!PaymentType == 'RECCURING PAYMENT'}" >
<div class="slds-form-element">
	<label class="slds-form-element__label">Setup Fee :</label>
	<apex:input styleClass="slds-input" value="{!SetupFee}" label="Setup Fee" required="true" />
</div>
</apex:outputpanel>


<apex:outputpanel rendered="{!PaymentType =='RECCURING PAYMENT'}" >
<div class="slds-form-element">
	<label class="slds-form-element__label">Recurring Start Date :</label>
	<apex:input styleClass="slds-input" value="{!startDate}" label="Payment Start Date" type="date" required="true" />
</div>
</apex:outputpanel>

<apex:outputpanel rendered="{!PaymentType =='RECCURING PAYMENT'}" >
<div class="slds-form-element">
	<label class="slds-form-element__label">Recurring End Date :</label>
	<apex:input styleClass="slds-input" value="{!EndDate}" label="Payment End Date" type="date" required="true" />
</div>
</apex:outputpanel>

<apex:form/>

Hope above code will help you, let me know If you have any question. 
Ramssf70Ramssf70
Hi chanti k,
The bellow code simple exmaple for what you mentioned above here  i am using account object whenever user change the name from picklist related values will display on the visual force page try the bellow code you may get some idea after trying this if you need any further help fell free to ask me
 
<apex:page controller="selectoptionclass1">

<apex:form>

<apex:selectList value="{!selectedaccoutname}"  size="1" multiselect="false">

<apex:actionSupport event="onchange" action="{!getvalue}"/>

<apex:selectOptions value="{!numlist}"/>

</apex:selectList>

<br/>
<apex:outputLabel>{!myacc.name}</apex:outputLabel><br/>
<apex:outputLabel>{!myacc.phone}</apex:outputLabel><br/>
<apex:outputLabel>{!myacc.fax}</apex:outputLabel>

</apex:form>



  
</apex:page>


public class selectoptionclass1
{
public List<selectoption> numlist{get;set;}
public string selectedaccoutname{get;set;}
public account myacc{get;set;}


public selectoptionclass1()
{
numlist = new List<selectoption>();
List<account> acclist = [select id,name from account limit 5];

for(account acc:acclist)
{
numlist.add(new selectoption(acc.name,acc.name));

}



}

public void getvalue()
{
myacc =[select name,phone,fax from account where name=:selectedaccoutname];

}


}

Thank you
chanti kchanti k
Thanks to all ...
Hi Ramss,

it's not working. only value is display in picklist. i want diplay 3 fileds after selecting the picklist value.

thanks Chanti