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

Assigning values to a dropdown list without using export value field

New Here ,
Oct 03, 2022 Oct 03, 2022

I have run into a road block with trying to keep export values assigned to the options in my list. I have two lists, one is dependant on the other. The issue I have is when I change the option on the non-dependant list, the values from the dependant list disappear. This leaves my code unable to work, being that it depends on the values assigned. Is there any way that I can code the values into the calculation field of dropdown 2? I've also attached the file itself, to see if that helps.Dropdown 2expand imageDropdown 1 Codeexpand imagePrice Codeexpand imageDependency Imageexpand image

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF forms
927
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 ,
Oct 03, 2022 Oct 03, 2022

When you set items you can also set export values like this:

this.getField("Dropdown2").setItems([["Month-to-Month",1],["Qarterly",2],["Annually",3]]);

I would also suggest you to check 'Commit selected value immediately' in dropdown field → options tab.

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 ,
Oct 03, 2022 Oct 03, 2022

There are errors in your code. Check the JS Console for details.

However, what you're describing is to be expected. If you change the value of the dependent field, any values associated with it will be changed as well. Not sure why that is a bad thing...

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
New Here ,
Oct 03, 2022 Oct 03, 2022

Hello, I don't think you quite understand my question. The whole point of this post is to try to retain the values within the dropdown menu, because my code is dependant on it. To go even further, I need those values to remain so the code I have placed in the pricing area knows what price to populate. The codeing isn't the issue. Also, I'll have you know that my code works perfectly fine besides the fact mentioned above. It has been answered, so your input is not needed. And a note for the future, whenthe question has been answered your opinionated input is not needed. Thanks and good day!

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 ,
Oct 03, 2022 Oct 03, 2022
LATEST

Sorry for trying to help you out with your buggy code, and good luck!

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