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
vanessa veronvanessa veron 

SelectList disable / enable

Hello,

I have 4 selectList and I would like when I click on one, the other three remain disable...
I click on another (even disable), the others are disable and it is enable...

How do I do this with JS??

I did something like this, but DONT WORK:

function enableJusteWeek(){
document.getElementById("{!$Component.theform.block01.month}").disabled;
document.getElementById("{!$Component.theform.block01.year}").disabled;
document.getElementById("{!$Component.theform.block01.week}").disabled;
}

.....

<apex:selectList size="7" value="{!days}" multiselect="true" onclick="enableJusteWeek();">

Best Answer chosen by vanessa veron
Doug BjoinDoug Bjoin
The following worked for me by adding it below the select box.

 <script>document.getElementById('{!$Component.oppEditPage:oppEditForm:opportunityPageId:opBlockId:bsi1:opStageName}').disabled = {!disableInput}; </script>

All Answers

Ashish_SFDCAshish_SFDC
HI Vanessa, 


What is the field type that you are using, did you try using a radio button which has similar function. 

See the  link below for using a radio button in visualforce.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_selectRadio.htm

http://www.infallibletechie.com/2012/07/radio-button-in-salesforce.html


Regards,
Ashish
vanessa veronvanessa veron
But how I can disable ??????????????
Doug BjoinDoug Bjoin
The following worked for me by adding it below the select box.

 <script>document.getElementById('{!$Component.oppEditPage:oppEditForm:opportunityPageId:opBlockId:bsi1:opStageName}').disabled = {!disableInput}; </script>
This was selected as the best answer
vanessa veronvanessa veron
Thank you!!!!!