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
Salesforce P1Salesforce P1 

How to make a item of a selectOptions readonly, once it is selected.

I need to make the selectd option readonly once the user selected it. Here is my Code.
 <apex:outputLabel value="Products"/>
   <apex:selectCheckboxes value="{!selProds}" layout="pageDirection" id="selprod" styleClass="selprod">
   <apex:selectOptions value="{!AProducts}"></apex:selectOptions> 
       </apex:selectCheckboxes>

Any help is really appreciated.
Khan AnasKhan Anas (Salesforce Developers) 
Hi Swarna,

Greetings to you!

You can use a read-only attribute, a Boolean value that specifies whether this selectCheckboxes component is rendered as read-only. If set to true, the checkbox values cannot be changed. If not selected, this value defaults to false.

Please refer to the below link which might help you further with the above requirement.

https://salesforce.stackexchange.com/questions/22425/apexselectlist-component-readonly-property-is-not-working

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas