9 Replies Latest reply on Mar 26, 2018 12:56 PM by try67

    reset dropdown to no value selected

    arvindkumar7 Level 1

      Hi Experts,

       

      I have problem adding new items to dropdown. Whenever I add items to dropdowns, first value is automatically set as default. I tried resetting dropdown with resetForm(["Dropdown1"]);  but it does not work because dropdown default value is first item while I want dropdown to reset to none value selected.

       

      I know there is way to add "" as first item in all of the dropdown but I do not want to use this.

       

      Regards

      Arvind

        • 1. Re: reset dropdown to no value selected
          try67 MVP & Adobe Community Professional

          There isn't really a way around it, unless you enable custom user input and then apply a blank value to the field's value property.

          1 person found this helpful
          • 2. Re: reset dropdown to no value selected
            George_Johnson MVP & Adobe Community Professional

            It's possible to do this with the help of a script, but dropdowns were not intended to behave this way so you can't do it manually.

            • 3. Re: reset dropdown to no value selected
              pdfUser1 Level 1

              Hi Arvind,

              Try this bit of script as a MouseUp action of a button instead of Reset. I use this script with great success, give this a try:

               

                          var f = this.getField("The name of your drop down");

                          f.value = "Choose";

               

              or this, if you want the drop down to be blank

               

                          var f = this.getField("The name of your drop down");

                          f.value = "";

               

              You could use it in the drop down action as well to clear/reset the field. Play around with it, you'll get the hang of it. I'm glad to help.

              • 4. Re: reset dropdown to no value selected
                soondodge Level 1

                Hello, thanks for pointing me in the right direction. I'm publishing to HTML and my captivate reset button was not working. I followed Lieve's design here for my Reset action and I suspected it didnt work because of publishing to HTML as opposed to SWF.

                 

                Could you guide me a little further on what your advanced action looks like for this solution? like what does your script in your script window read?

                 

                Thank you,

                Soon

                • 5. Re: reset dropdown to no value selected
                  gkaiseril MVP & Adobe Community Professional

                  If the drop down is setup with a  "no value selected", then one can use the "resetForm"method.

                   

                  this.resetForm(["Drop Down Field Name goes here"]);

                   

                  Note that the parameter for this method is an array and the field name or field names need to be between "[]" or be an array variable.

                  • 6. Re: reset dropdown to no value selected
                    soondodge Level 1

                    Hello, this worked for me except I also needed to jump the user to a "Reset" slide. to trigger the blank or dummy value showing up in the drop down (DD). My content is written to include multiple drop downs in one Check on Learning type interaction slide. My client wanted correct selections to remain selected in the DD, while if the learned answered incorrect, the list would be "Reset" after selecting a "Submit" button.

                    This is how I got my "Reset Drop Down" script working: my first entry in my drop downs is always "(selection)" so I also created a custom variable named "dropdown_dummy" set to a literal = (selection). The learner chooses selections from the drop down list and afterwards selects the Submit button, then I run a conditional advanced action that checks the value of each DD variable (must create these as empty custom var for each drop down) that has been selected. In a case that the correct answer is alphabet, here is my conditional action: if DDvar0 = alphabet, show correct feedback popup. else: assign DDvar0 with "dropdown_dummy" and jump to previous slide to reset. I have a blank slide timed for .10 seconds that has an on-enter action of "continue." Then the learner lands back on the drop down interaction slide and sees the drop down list popuplated with the "dropdown_dummy" variable which is (selection). 

                    Hope this helps. I'm always looking to find solutions that do not require javascript because it is not supported by our end users content management team.

                    • 7. Re: reset dropdown to no value selected
                      try67 MVP & Adobe Community Professional

                      What you described requires JS. You can't do conditional execution of commands without it.

                      • 8. Re: reset dropdown to no value selected
                        soondodge Level 1

                        I'm confused at your comment. What I described is working for me - no JS. I am publishing to HTML, would you like to see my sample .cptx?

                        • 9. Re: reset dropdown to no value selected
                          try67 MVP & Adobe Community Professional

                          This forum is about PDF files, not Captivate.