+ Start a Discussion

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}">




is it possible ??


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




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