+ 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