4 Replies Latest reply on Nov 1, 2016 7:12 PM by Edd0

    Is auto tab from drop down box possible?

    Edd0 Level 1

      Hi,

       

      I am creating a form for local tennis clubs in the Association to enter their teams in an editable PDF. I have been able to create a form that will spawn new forms from a template, and work the way I want it to. None of this would have been possible without the info and scripts I found here, hence this request.

       

      The auto tab function would be useful in the drop down boxes after entering the key data about each team. There are 5 drop-down boxes in a row, each of which must be completed before they can start entering players. I have made each drop down box read-only until the previous box has been completed. This is necessary to be done at the time, so that they don't have to go back at the end to find uncompleted fields. Each of these drop-down boxes has "Required" set, and I have ticked "Commit selected value immediately".

       

      In the Actions tab I have added the following javascript to the "On Blur" event that tests if a value other than the default value has been entered. If it has, it makes the next field's readonly value false, turns the grey back to the standard colours, and changes focus to the next field.

       

      var nFld = this.getField("P0.FormBody.SectionType");

      var oNmlFld = this.getField("NormalColoursFld");

      var f = this.getField("P0.FormBody.Grade");

      if (event.value == "Select a Grade")

          {

          f.setFocus()

          app.alert("Please select a Grade.")

      }

      else{

          // Restore Normal Colours

          nFld.fillColor = oNmlFld.fillColor;

          nFld.borderColor = oNmlFld.borderColor;

          nFld.textColor = oNmlFld.textColor;

          nFld.readonly = false;    

          nFld.setFocus();

      }

       

      I cannot figure out how to make the cursor go to the next field immediately a drop down item is selected. Tabbing will move the cursor to the next drop down box, but I would like the cursor to immediately go to the next field once a choice has been made in the current field. At the moment, the next drop down box remains grey, even though a selection has been made in the current field, until the tab key is pressed and the focus goes to the next field. This form is going to be used by some people not used to this sort of document, and to see something as grey would indicate it is not available, yet it is.

       

      I have seen numerous posts on how the auto tab can work on text fields by setting a line length limit and similar tests, such as Keystroke validation, but this option is not available for a drop down box. One of these indicate it will work if the "willCommit" code is true in the text box, but it is set in the drop down boxes I am using and is not working.

       

      Any ideas as to how I can make this form behave the way I would like?

        • 1. Re: Is auto tab from drop down box possible?
          try67 MVP & Adobe Community Professional

          You should use the Validation event. Make sure to tick the box (under the field's Properties, Options tab) to commit the selected value immediately.

          1 person found this helpful
          • 2. Re: Is auto tab from drop down box possible?
            Edd0 Level 1

            That was one of the first things I did when I read how this option worked. All drop down boxes have this Option selected.

            • 3. Re: Is auto tab from drop down box possible?
              gkaiseril MVP & Adobe Community Professional

              What is the script for your "autotab"?

               

              This is not a built-in feature for Acrobat.

               

              What are the values for the export values drop down box?

               

              Is there an option for a non-selection?

               

              Is this form page being generated from a template?

               

              If so, does this need to work on spawned pages?

              • 4. Re: Is auto tab from drop down box possible?
                Edd0 Level 1

                What is the script for your "autotab"?

                I hadn't found one I thought I could use. All scripts I had seen on the forums were written for text fields and I didn't know how to apply the same to a drop down box. I haven't done any coding before, so wasn't sure how to begin to adapt the script to a drop down box.

                 

                This is not a built-in feature for Acrobat.

                The reading of the forum made that clear, but that scripts can go some way to providing that feature.

                 

                What are the values for the export values drop down box?

                I have set numerical values for each text line in the drop down boxes, ranging from 0 for the default up to a high of 5 for one of them. The first has 2 choices, second has 5 (and has 2 lists, determined by choice in first box), third has 3 and fourth has 3.

                 

                Is there an option for a non-selection?

                People using the form are entering tennis teams. Each box describes Format, Grade, Section Type and Section Position. A non-selection means that the form won't advance to the next drop down box. Each is required for the form to be of practical use, so none of these can be excluded. The sample code above does force a valid selection to be made before the next field can be accessed.

                It is a requirement of those processing this Entry Form that it be completed in full before the next Entry Form can be generated. The current paper form has been returned with some of these required fields, that are now the drop down boxes, not completed. This just takes up more time of the volunteer who process the forms, so enforcing completion will save time for everybody in the long run. He is processing around 850 - 900 from around 100 clubs, so extra work isn't a good thing.

                 

                Is this form page being generated from a template?

                The original Entry Form page is the first page, with subsequent Entry Forms being spawned from a two-part template (top is the Club Name, the rest is the body of the form).

                 

                If so, does this need to work on spawned pages?

                Yes.