13 Replies Latest reply on Jan 5, 2018 6:15 AM by davidi94363693

    Simultaneously check/uncheck two checkboxes with different names-always checked or unchecked together

    davidi94363693 Level 1

      I have a form with two groups of related products and prices. When a user checks one product from the first group, I need it to automatically check the related product from the second group and display their prices if checked. They both need to uncheck together as well.

      The checkboxes in the different product groups need different names because I am also showing/hiding related prices based on the checkbox being checked and a variable quantity.

      My code doesn't quite work:

       

      The code for the First Checkbox

      1. Displays the Price field when checkbox is checked, and
      2. Checks both boxes (First Checkbox + Matching Checkbox)
      3. but, it won't uncheck both boxes if one or the other is unchecked.

       

      var nHide = event.target.isBoxChecked(0)?display.visible:display.hidden;

       

      this.getField(“Price”).display = nHide;

       

      if (event.target.value!="Off") this.getField(“Matching Checkbox”).checkThisBox(0, true);

       

      Is it possible to get the checkboxes to check and uncheck together, just as if they had the same name?

      Thanks for any assistance you can provide!