6 Replies Latest reply on Feb 4, 2011 3:18 PM by sb25newbie

    Can an Answer from Listbox automatically fill a checkbox

    sb25newbie

      I have a form that asks several questions.  Each question has a set of checkboxes on the left with a correlating list box of points on the right.  Is there a way for the form to automatically fill the checkbox on the left when the point amount is chosen or vice versa?  Please see the example below.

       

      In approximately how many years do you expect to need this money?

       

      Check Box Answers                                Points (List Box)

        2 – 3 years                                                  20
        4 – 6 years                                                  38
        7 – 10 years                                                 50
        10+ years                                                    69


      If you expect to have other major expenses (such as college tuition, home down payment, home repairs, etc.), do you have a separate savings plan for these expenses?

       

      Check Box Answers                                                              Points (List Box)                               

        Yes, I have a separate savings plan for these expenses.                     0
        I do not expect to have any such expenses.                                      1
        I intend to withdraw a portion of this money for these expenses           3
        I have no separate savings plan for these items at this time.                4

       

      Any assistance with this question greatly appreciated.

        • 1. Re: Can an Answer from Listbox automatically fill a checkbox
          George_Johnson MVP & Adobe Community Professional

          sb25newbie wrote:

           

          Is there a way for the form to automatically fill the checkbox on the left when the point amount is chosen or vice versa?

           

          Yes, you can do that. Which of those two options would you prefer? It seems like the question is directing the user to select a check box though. Do you want the user to be able to select an item in the list box as well?

          • 2. Re: **New Question** with different form fields. Can Checkbox Answers autofill Drop Box List?
            sb25newbie Level 1

            ** New Question with different form fields. Can Checkbox Answers autofill a Drop Box List?

             

            I have a form that asks several questions.  Each question has a set of checkboxes on the left with a correlating DROP BOX of points on the right.  Is there a way for the form to automatically fill the checkbox on the left when the point amount is chosen or vice versa?  Please see the example below.

             

            SAMPLE QUESTION #1

            In approximately how many years do you expect to need this money?

             

            Check Box Answers                                Points (Drop Box)

              2 – 3 years                                                  20
              4 – 6 years                                                  38
              7 – 10 years                                                 50
              10+ years                                                    69

             

            SAMPLE QUESTION #2

            If you expect to have other major expenses (such as college tuition, home down payment, home repairs, etc.), do you have a separate savings plan for these expenses?

             

            Check Box Answers                                                              Points (Drop Box)                             

              Yes, I have a separate savings plan for these expenses.                     0
              I do not expect to have any such expenses.                                      1
              I intend to withdraw a portion of this money for these expenses           3
              I have no separate savings plan for these items at this time.                4

             

            Any help with this would be greatly appreciate

            • 3. Re: Can an Answer from Listbox automatically fill a checkbox
              sb25newbie Level 1

              I have now added a drop down box for the list of points.  So yes, I would like the checkbox answers to checked by the individual and the Points Drop Down box to automatically fill.

               

              Carmelle

              • 4. Re: Can an Answer from Listbox automatically fill a checkbox
                George_Johnson MVP & Adobe Community Professional

                If you set the export value of each check box equal to the number of the corresponding combo box item, the MouseUp script for each check box could be:

                 

                // Mouse Up script for check box

                getField("your_combo").value = event.target.value !== "Off" ? event.target.value : 0;

                 

                 

                This assumes that all of the check boxes in the group have the same name and different export values. Since check boxes allow none in the group to be selected, you need to account for that in the script, which means you need to add an item to the combo box for the case when none of the check boxes are selected. In the script above, it assumes this item has an export value of 0, so when you add it, make sure to set the export value to 0.

                • 5. Re: Can an Answer from Listbox automatically fill a checkbox
                  sb25newbie Level 1

                  I have an checkbox that has a point value in the drop box that is 0, which part of the script do I remove to get the 0 to autofill? 

                   

                  Have a wonderful day!

                   

                  Carmelle Nemechek

                   

                   

                   

                   

                  Date: Fri, 4 Feb 2011 15:26:12 -0700

                  From: forums@adobe.com

                  To: clnemechek@msn.com

                  Subject: Can an Answer from Listbox automatically fill a checkbox

                   

                  If you set the export value of each check box equal to the number of the corresponding combo box item, the MouseUp script for each check box could be:

                   

                  // Mouse Up script for check box

                  getField("your_combo").value = event.target.value !== "Off" ? event.target.value : 0;

                   

                   

                  This assumes that all of the check boxes in the group have the same name and different export values. Since check boxes allow none in the group to be selected, you need to account for that in the script, which means you need to add an item to the combo box for the case when none of the check boxes are selected. In the script above, it assumes this item has an export value of 0, so when you add it, make sure to set the export value to 0.

                  >

                  • 6. Re: Can an Answer from Listbox automatically fill a checkbox
                    George_Johnson MVP & Adobe Community Professional

                    Change the zero in the following line to the export value of whichever item you want selected in the combo box when none of the check boxes are selected:

                     

                    getField("your_combo").value = event.target.value !== "Off" ? event.target.value : 0;