2 Replies Latest reply on Dec 10, 2011 10:58 PM by stealthrs

    Checkbox auto-answer if 2 above are checked?

    stealthrs Level 1

      I have a total of 6 check boxes with 3 different names, because it's a Yes or No entry-type

       

      • 2 boxes named Piloting (export values are PYes and PNo)
      • 2 boxes named Avocations (export values are AYes and ANo)
      • 2 boxes named PilotorAvocations (export values are PAYes and PANo) - which will be a read only

       

      Here's my issue.... I want the textbox of PilotorAvocations to automatically answer (or the box to be checked) if PYes or AYes are exported.  So either one being a Yes (or both), leads the PilotorAvocations boxes to yield a yes... If they're both No, then PilotorAvocations yields no...

       

      I've tried if then's, I've tried learning about Child and Parents... I cannot figure it out.  Any helpers?  Very curious how it's done....

        • 1. Re: Checkbox auto-answer if 2 above are checked?
          gkaiseril MVP & Adobe Community Professional

          You may not have considered all possible states for the checked buttons.

           

          When a Radio Button group or Check Box group has no selected item, the the value of the  group is "Off".

           

          Have you set the default checked value?

           

          Is the PilotorAvaocations field a text field or Check Box field?

          • 2. Re: Checkbox auto-answer if 2 above are checked?
            stealthrs Level 1

            Sorry for the delay, been slammed.  I have not set the default checked value, but I have changed the export values. PilotorAvaocations is also a checkbox.  Basically if the first and second checkboxes I mentioned are checked No, then I want the 3rd checkbox (PilotorAvocations) to check no...  If either of the first two checkboxes are checked (one could be yes, one could be no) I need the 3rd checkbox to be a YES automatically...

             

            Let me copy+paste what I've tried... Because I actually do try to figure this stuff out myself

             

            Here's what I was planning on writing for the PilotorAvocations NO checkbox:

             

            var f = this.getField("Piloting");

            var g = this.getField("Avocations");

            var h = this.getField("PilotorAvocations");

             

            if (f.value=="PNo" && g.value=="ANo")

            {

                h.value = "PANo";    

            }

            else

            {

                h.value = "";

            }

             

            Here's what I was planning on writing for the PilotorAvocations YES checkbox:

             

            var f = this.getField("Piloting");

            var g = this.getField("Avocations");

            var h = this.getField("PilotorAvocations");

             

            if (f.value=="PYes" || g.value=="AYes")

            {

                h.value = "PAYes";    

            }

            else

            {

                h.value = "";

            }

             

             

            How can I force the answers from the 1st and 2nd checkbox spring the PilotorAvocations checkbox into action and answer itself?  As a reminder, the export values of PilotorAvocations are PAYes and PANo