You need to sign in to do that
Don't have an account?
srikanth Gottimukkala
How to disable picklist value once it has been chosen
How to disable picklist value once it has been chosen in apex page block table.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
You can use javascritpt to do this easily.
can see the below code .You will get idea.
------------------------------------Controller-------------------------------------
public class ShowSectionController
{
public Account acc{get;set;}
public boolean flag{get;set;}
public ShowSectionController()
{
acc = new Account();
flag = true;
}
public void hideSectionOnChange()
{
if(acc.married__c == 'Yes')
flag = false;
if(acc.married__c == 'No')
flag = true;
}
}
-----------------------------------------------------------------------------------------------
---------------------------------------VF page----------------------------------------------
<apex:page controller="ShowSectionController" tabStyle="Account">
<apex:form >
<Apex:actionFunction name="hideSection" action="{!hideSectionOnChange}" rerender="pg"/>
<apex:pageBlock id="pg">
<apex:pageBlockSection title="Select A">
<apex:inputField value="{!acc.Married__c}" onchange="hideSection('{!acc.Married__c}')"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Section B" >
<Apex:inputText label="Name" rendered="{!(!flag)}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
You need to query on existing records on controller side, describe picklist values & populate picklist values those records are not created in your_option variable.
If this answers your question mark Best Answer it as solution and then hit Like!