How do I check a checkbox in Plumsail forms

Hi,

I need to implement the following function:

When "code red" and "not Urgent" are checked, the "not urgent" is immediately unchecked and the "Urgent" is checked. As "code red" only goes with "Urgent". How do I implement this?

image

Thank you,

Dear @jyou,
Hmm, are these two different fields? One is multiple choice (checkboxes) and one is single choice (radio), right?

The following code should work (just make sure to change field names to yours, and make sure the text values match exactly):

fd.spRendered(function(){
    function updateUrgency(){
      if(fd.field('Code').value.indexOf('Code Red') >= 0){
        fd.field('Urgency').value = 'Urgent/Production release';
        fd.field('Urgency').disabled = true;
      }
      else{
        fd.field('Urgency').disabled = false;
      }
    }

    fd.field('Code').$on('change', updateUrgency);

    updateUrgency();
});

It would also disable the Urgency field, so it cannot be edited.