1 Reply Latest reply on Oct 16, 2012 11:24 AM by creditunion123

    Using Dialogue box in adobe. Javascript && not doing what I want it to

    creditunion123

      Ok, I have a dialoge box that pops open for staff and asks them what it is they are doing - Reducing Interest Rate, Changing payment frequency, Changing payment amount or suspending payment.  I have fields that show/hide based on those choices

       

      If they hit only 1 choice the form works like a charm.  If however they hit two choices it does not

      I see what the form is doing but I do not know how to fix

       

      For a small example I have (put very simply)

       

      Fields 1, 2, 3 and 4 - all hidden

       

      button 1 = false

      button 2 = false

      button 3 = false

      button 4 = false

       

       

      if button 1 = true

      unhide Fields 2, 3 and 4

       

      If button 2 = true

      unhide Fields 1, 3 and 4

       

      if button 3 = true

      unhide Fields 1, 2 and 4

       

      if button 2 && 3 are true then:

      unhide Fields 1 and 4

       

      but what it does is show button 2 = true so unhides fields 1, 3 and 4 and then says button 3 = true so unhides Fields 1, 2 and 4 - so it ends up all my fields unhide

       

      I am sure there is probably a quick fix but I am at a loss

      I will attempt to attach my full code shortly

        • 1. Re: Using Dialogue box in adobe. Javascript && not doing what I want it to
          creditunion123 Level 1

          // did the value change when ticked - lets check  THIS IS THE CODE I HAVE

          Alteration.bChk2 = false;

          Alteration.bChk3 = false;

          Alteration.bChk4 = false;

          Alteration.bChk5 = false;

           

          if ("ok" == Alteration.DoDialog()) {

               if (Alteration.bChk2 && Alteration.bChk4) {

                   getField("FormValues.Loan.compoundingPeriod_Checkbox").display = display.visible;

                   getField("FormValues.variance").display = display.visible;

                   getField("FormValues.Loan.paymentFrequency_Checkbox").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_Weekly").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_BiWeekly").display = display.visible;

                   getField("FormValuesLoan.paymentDay").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly1st").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly2nd").display = display.visible;

                   getField("Periodic Payment Area").display = display.noPrint;

                   getField("reduced interest rate").checkThisBox(0,true);

                   getField("suspended periodic payment").checkThisBox(0,true);

                  }            

          if (Alteration.bChk2 && Alteration.bChk5) {

                   getField("FormValues.Loan.compoundingPeriod_Checkbox").display = display.visible;

                   getField("FormValues.variance").display = display.visible;

                   getField("FormValues.Loan.interestOnly_Checkbox").display = display.visible;

                   getField("FormValues.paymentAmount").display = display.visible;

                   getField("Periodic Payment Area").display = display.noPrint;

                   getField("Periodic Pay Frequency Area Area").display = display.noPrint;

                   getField("reduced interest rate").checkThisBox(0,true);

                   getField("change periodic payment frequency").checkThisBox(0,true);

                   }            

          if (Alteration.bChk3 && Alteration.bChk5) {

                  getField("FormValues.Loan.compoundingPeriod_Checkbox").display = display.visible;

                   getField("FormValues.variance").display = display.visible;

                   getField("FormValues.rateType").display = display.visible;

                   getField("FormValues.Loan.fixedRate").display = display.visible;

                   getField("FormValues.Loan.variance_GT").display = display.visible;

                   getField("Periodic Pay Frequency Area").display = display.noPrint;

                   getField("Periodic Payment Area").display = display.noPrint;

                   getField("change periodic payment frequency").checkThisBox(0,true);

                   getField("reduced periodic payment amount").checkThisBox(0,true);

               }

              if (Alteration.bChk2) {

                   getField("FormValues.Loan.paymentFrequency_Checkbox").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_Weekly").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_BiWeekly").display = display.visible;

                   getField("FormValuesLoan.paymentDay").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly1st").display = display.visible;

                   getField("FormValues.Loan.interestOnly_Checkbox").display = display.visible;

                   getField("FormValues.paymentAmount").display = display.visible;

                   getField("Interest Rate Area").display = display.noPrint;

                   getField("reduced interest rate").checkThisBox(0,true);

                   }    

          if (Alteration.bChk3) {

                   getField("FormValues.rateType").display = display.visible;

                   getField("FormValues.Loan.fixedRate").display = display.visible;

                   getField("FormValues.Loan.variance_GT").display = display.visible;

                   getField("FormValues.Loan.compoundingPeriod_Checkbox").display = display.visible;

                   getField("FormValues.variance").display = display.visible;

                   getField("FormValues.Loan.paymentFrequency_Checkbox").display = display.visible;

                   getField("FormValues.Loan.periodicPaymentDatesDays_Weekly").display = display.visible;

                  getField("FormValues.Loan.periodicPaymentDatesDays_BiWeekly").display = display.visible;

                  getField("FormValuesLoan.paymentDay").display = display.visible;

                  getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly2nd").display = display.visible;

                  getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly1st").display = display.visible;

                  getField("Periodic Payment Area").display = display.noPrint;

                  getField("reduced periodic payment amount").checkThisBox(0,true);

                  }           

          if (Alteration.bChk4) {

                  getField("FormValues.Loan.compoundingPeriod_Checkbox").display = display.visible;

                  getField("FormValues.variance").display = display.visible;

                  getField("FormValues.Loan.paymentFrequency_Checkbox").display = display.visible; 

                  getField("FormValues.Loan.periodicPaymentDatesDays_Weekly").display = display.visible;

                  getField("FormValues.Loan.periodicPaymentDatesDays_BiWeekly").display = display.visible;

                  getField("FormValuesLoan.paymentDay").display = display.visible;

                  getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly1st").display = display.visible;

                  getField("FormValues.Loan.periodicPaymentDatesDays_SemiMonthly2nd").display = display.visible;

                  getField("FormValues.Loan.interestOnly_Checkbox").display = display.visible;

                  getField("FormValues.paymentAmount").display = display.visible;

                  getField("FormValues.rateType").display = display.visible;

                  getField("FormValues.Loan.fixedRate").display = display.visible;

                  getField("FormValues.Loan.variance_GT").display = display.visible;

                  getField("suspended periodic payment").checkThisBox(0,true);

                  getField("Suspend Payment").display = display.noPrint;

                   }   

          if (Alteration.bChk5) {

                  getField("FormValues.Loan.compoundingPeriod_Checkbox").display = display.visible;

                  getField("FormValues.variance").display = display.visible;

                  getField("FormValues.Loan.interestOnly_Checkbox").display = display.visible;

                  getField("FormValues.paymentAmount").display = display.visible;

                  getField("FormValues.rateType").display = display.visible;

                  getField("FormValues.Loan.fixedRate").display = display.visible;

                  getField("FormValues.Loan.variance_GT").display = display.visible;

                  getField("Periodic Pay Frequency Area").display = display.noPrint;

                  getField("change periodic payment frequency").checkThisBox(0,true);

                   }

              

               console.println("Chk2:" + Alteration.bChk2);

               console.println("Chk3:" + Alteration.bChk3);

               console.println("Chk4:" + Alteration.bChk4);

              console.println("Chk5:" + Alteration.bChk5);

            }

           

          So when I check button 2 and 5 is shows button 2 true and does button 2 work and shows button 5 true and does button 5 work. I want it only to do the condition under the && condition

          Header 1