The dropdown list doesn't display the other dropdown values
- April 24, 2024
- 1 reply
- 669 views
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
