Code not triggering pre-set rule

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
Hi everyone. I have defined a rule to hide/ unhide a tab based on if a checkbox field was checked/ unchecked. But I am checking the box through a manually written JS code. When I click the checkbox individually, the rule is triggered but not when the box is checked through code. Can anyone help me with it?
Photo of Gauri Phansikar

Gauri Phansikar

  • 226 Points 100 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,302 Points 20k badge 2x thumb
I would not mix (1) natives rules and (2) JavaScript to control the same feature. Use a 100% native solution or 100% JavaScript solution. Even when you use JavaScript rather than directly manipulating the DOM it is better practice to emulate user input such as trigger a click event on a native button or link.
Photo of Gauri Phansikar

Gauri Phansikar

  • 226 Points 100 badge 2x thumb
Thank you for your quick response. I will keep your advice in mind.