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
lakshmi25lakshmi25 

how to disable checkbox field checkbox

if i check one checkbox in checkbox field how to disable another checkbox field checkbox? i wrote this code but not working

please corect it.

 

<script>
  function disable(Id1,Id2)
   {
 var  x =document.getElementById("Id1");
 var  y = document.getElementById("Id2");
  for ( var i=0; i <x.length; i++){
  if (x[i].checked =true)
{
  y[i].disabled ='true';
}  
  }
   
   }
   </script>

bob_buzzardbob_buzzard

You'll need to use the $Component notation to locate the element that you want to delete.

 

Check out:

 

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