You are viewing limited content. For full access, please sign in.

Question

Question

Mark Check-boxes Read-only (Java or CSS?)

asked on February 1, 2018

I have a form that I need to see if I can make a check box or set of check boxes read only if one or some are selected.  Its a funds request that will route to the appropriate director based on the category they select.  If the other option is selected I want the other three check boxes to become read only, and if any of the other three are selected I want the other box to become read only.  Does anyone out there know of a way I can do this?  I understand that there are other things I can do to make it work, but I am trying to avoid having to change the currently available variables which would cause me to make significant changes to the process diagram.  Any help would be appreciated!

 

0 0

Replies

replied on February 1, 2018

This is one way to do it. You would just need to update the Filed ids to correspond to your form. You can find what the field id is by right-clicking a checkbox and choosing "Inspect" in Chrome.

$( document ).ready(function() {
   
  
  $(document).on('click', '.Checkbox input', mkUpdate);
  
  function mkUpdate() {
    
          if ( ($('#Field1-0').is(':checked')) || ($('#Field1-1').is(':checked')) || ($('#Field1-2').is(':checked')) ){

            $('#Field1-3').attr('disabled', true);

        }
          else
          {
			$('#Field1-3').removeAttr('disabled');

          }
    
    
          
    
      if ($('#Field1-3').is(':checked')) {

            $('#Field1-0').attr('disabled', true);
            $('#Field1-1').attr('disabled', true);
            $('#Field1-2').attr('disabled', true);

        }
          else
          {

            $('#Field1-0').removeAttr('disabled');
            $('#Field1-1').removeAttr('disabled');
            $('#Field1-2').removeAttr('disabled');

          }
    
    
  }
  
  
});

 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.