Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

reset dropdown to no value selected

Participant ,
Sep 25, 2016 Sep 25, 2016

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

TOPICS
Acrobat SDK and JavaScript
6.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2016 Sep 25, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 24, 2018 Mar 24, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2018 Mar 24, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2016 Sep 25, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2016 Sep 27, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 12, 2018 Mar 12, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 12, 2018 Mar 12, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 26, 2018 Mar 26, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 26, 2018 Mar 26, 2018
LATEST

This forum is about PDF files, not Captivate.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines