Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you so much for all these clarifications, it works! and I've learnt something new today 🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now