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

The dropdown list doesn't display the other dropdown values

Community Beginner ,
Apr 24, 2024 Apr 24, 2024

Please I'm new with JavaScript and I need your help with this :

I've created 7 dropdown lists: "Product", "StoreA", "StoreB", "StoreC", "StoreD", "StoreE" and "DeliveryTime".

Each dropdown list has the following values :

- "Product" : "Select an item", "Item 1", "Item 2", "Item 3" and "Item 4"

- "StoreA" : " "

- "StoreB" : "Store 1"

- "StoreC" : "Store 2"

- "StoreD" : "Store 3", "Store 4"

- "StoreE" : "Store 5"

The  "StoreA", "StoreB", "StoreC", "StoreD", and "StoreE" are visible/hide based on a value from the "Product" dropdown list. I made a javascript code adequate in a custom validation script and it works pefectly!

My issue is with the "DeliveryTime", I want it to be populated based on the dropdown list visiblity  :

- if "StoreA" is visible then "DeliveryTime" = " "

- if "StoreB" is visible then "DeliveryTime" = "5 days"

- if "StoreC" is visible then "DeliveryTime" = "6 days"

- if "StoreD" is visible : with the value "Store 3" the "DeliveryTime" = "3 days or 7 days", and with the value "Store 4" the "DeliveryTime" =  "4 days"

- if "StoreE" is visible then "DeliveryTime" = "3 days or 7 days"

but the code that I made for this doesn't work. the file is in the attachment and sorry to be so long-winded

TOPICS
JavaScript , PDF forms
637
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
1 ACCEPTED SOLUTION
Community Expert ,
Apr 24, 2024 Apr 24, 2024

Validate script is triggered when value of the field changes, making the field visible/hidden doesn't trigger validation script, so use the script for delivery in the field where you trigger Store fields visibility.

 

View solution in original post

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 ,
Apr 24, 2024 Apr 24, 2024

Validate script is triggered when value of the field changes, making the field visible/hidden doesn't trigger validation script, so use the script for delivery in the field where you trigger Store fields visibility.

 

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 ,
Apr 24, 2024 Apr 24, 2024
LATEST

Thank you so much for all these clarifications, it works! and I've learnt something new today 🙂

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