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
viv1viv1 

Assign default value to an inputfield of type picklist

i have custom vf page..

which has i input filed assigned with picklist..

and it is dependent on other picklist value..

i have the value of picklist which to set default but how to set it ???

 

<apex:inputField value="{!item.Category__c}">

           

</apex:inputField>

 

is it possible ??

cloudmaniacloudmania

If you change "item.Category"'s value page on load , it should be automatically shown up in picklist on ur VF!

Vinit_KumarVinit_Kumar

Viv,

 

The following  code works :-

 

<apex:inputField id="accountSport" value="{!account.Sport__c}"/>

 

 where Sport__c is the custom picklist field on Account and shows the default value which I have selected on VF page