1 Reply Latest reply on Dec 31, 2009 1:26 PM by Kevin Cavallo

    mutually exclusive checkboxes

    lpianwi Level 1

      Hi,

       

      I am writing code to make two checkboxes mutually exclusive. It works, but one cannot uncheck the checked box if one decides. It basically treats it as Radio button which is not what the desire result should be. Here is the code.

       

      if

       

      (this.rawValue=1)

      {

      CheckBox2.rawValue

      = 0;

      }-------for the first checkbox

       

      And

       

      if

       

      (this.rawValue=1)

      {

      CheckBox1.rawValue

      = 0;

      }

       

      for the second.

       

      Is there anyone out there who knows what I may be doing wrong?

       

      Thanks

       

      LP

        • 1. Re: mutually exclusive checkboxes
          Kevin Cavallo Level 4

          Minor issue.  In javascript you test for equality using two equal signs, not one.  Each script should read: if (this.rawValue==1)

           

          What's happening now is that you're setting the rawValue equal to 1 each time you execute the if statement, so it's always re-checking the box on you.

           

          Also, you have probably already done this: the scripts should be in the Change event.  I couldn't tell from your code snippet.

           

          Cheers,

          Kevin