6 Replies Latest reply on Feb 8, 2009 5:36 PM by Fredy119

    Count the number of checkboxes checked and display a message?

    Fredy119
      Hi
      I have 15 checkboxes in a form and provide feedback to students by turning the background color to red or green.
      I call the function from a button:
      TestLetter1();
      function TestLetter1()
      {

      var f = this.getField("checkbox1");
      if(f.isBoxChecked(0))
      f.fillColor = color.red;

      var f = this.getField("checkbox2");
      if(f.isBoxChecked(0))
      f.fillColor = color.green;

      and so on

      Now I want to count the number of boxes checked. If the number is bigger than five I want to display an app.alert and clear the boxes. Else I want to call the function TestLetter1()
      Can somebody help me, cause this seems to be too complex for me.
      Thank you.