+ Start a Discussion
MMA_FORCEMMA_FORCE 

How to disable picklist value once it has been chosen??

Hi all:

   I am trying to refresh my picklist when a value is selected.So here it is:

  1. Picklist Value ==> English, ELL, Math
  2. When user selects English, it refreshes the picklist and now the picklist values are ELL and Math and English is disabled.
  3. Then when user selects Math, it refreshes the picklist and now the picklist values is ELL and Math is disabled..

I have no idea how to do it... Here is my code:

 

<table border="0" id="theTable3" cellpadding="0" cellspacing="0" >
<tr>
<td>
<apex:outputLabel value="Advance Filter" for="theadvance"/><br/>
<apex:selectList value="{!theadvance}" size="1">
<apex:selectOption itemValue="Advance" itemLabel="Advance"/>
<apex:selectOption itemValue="English Proficiency" itemLabel="English Proficiency"/>
<apex:selectOption itemValue="Special Education" itemLabel="Special Education"/>

<apex:selectOption itemValue="Math" itemLabel="Math"/>
</apex:selectList>

</td>
<td>
<apex:outputPanel id="strackd" rendered="{!theadvance=='English Proficiency'}">

<apex:outputLabel value="English Proficiency"/>
<apex:selectList value="{!engname}" size="1" >
<apex:selectOption itemValue="ALL" itemLabel="Please Select a Value"/>
<apex:selectOption itemValue="1634: Fluent English Speaker" itemLabel="Fluent English Speaker"/>
<apex:selectOption itemValue="1633: Native English Speaker" itemLabel="Native English Speaker"/>
<apex:selectOption itemValue="1635: Non-English Speaking" itemLabel="Non-English Speaking"/>
<apex:selectOption itemValue="2349: Limited English Proficient/English Language Learner" itemLabel="Limited English Proficient/English Language Learner"/>
<apex:selectOption itemValue="1636: Redesignated As fluent English Proficient" itemLabel="Redesignated As fluent English Proficient"/>
<apex:selectOption itemValue="9997: Unknown" itemLabel="Unknown"/>

</apex:selectList>
</apex:outputPanel></td>
<td>
<apex:outputPanel id="strackdd" rendered="{!theadvance=='Special Education'}">
<apex:outputLabel for="spevalue" value="Special Education:" style="align:left"><apex:inputCheckbox id="spevalue" value="{!spevalue}" /></apex:outputLabel>
</apex:outputPanel></td></tr>
</table>

 Thanks

 

 

 

Message Edited by MMA_FORCE on 04-01-2010 08:00 AM
Ispita_NavatarIspita_Navatar

If you dis-able the select options , then how will the user select it again, the requirement stated by you.

I think what should be the case is don't allow user to select the disabled option if that is the case then the following is the a possible solution.

 

You can use javascript to implement your requirement that is diable the unselected option.

What you actually want is if an option is selected then then others should not be avaialable for selection, so you can implement a javascript code which returns false whenever an unselected option is selected giving the impression that no action happens when an unselected option is selected by user.

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.