disable radio box depending on another selection

disable radio box depending on another selection

LimpEmuLimpEmu Posts: 68Questions: 18Answers: 1

I am using the following syntax to disabled radio box trregd based on the selection of radio box trhist, but it's not working. I am guessing since I have to address each of the two radio boxes separately, but it entirely escapes me how to do so:

     editor.dependent( 'trhist', function ( val ) {
         if (editor.field('trhist').val() == "1") return { enable: ['trregd']};
         else return { disable: ['trregd']}; 
       });

This question has an accepted answers - jump to answer

Answers

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17
    Answer ✓

    Have you tried to do it this way?

    editor.dependent( 'trhist', function ( val, data, callback ) {
        if (val == "1") return { enable: 'trregd'};
        else return { disable: 'trregd'};
      });
    
  • LimpEmuLimpEmu Posts: 68Questions: 18Answers: 1

    That works. Thank you!

This discussion has been closed.