When we select Booking.com Sub OTA Type dropdown should getting empty and filed with value like “A,B,C” and if select Trip.com on change again Sub OTA Type dropdown to get empty and fill with “E,F,G”.
Where do you want to add this ? On service requests forms or on ticket form ?
advice : When you paste code, please use “preformatted text” button, and copy the entire functions so that we can try to understand what it does and what it shoudl.
Below is what am trying to do
– Clear existing dropdown value
– Add new values based on arrays value
It seems that dropdown selection is getting cleared and changed with new values but their is a list / div attached with choices is not getting updated or clear
After i run the code below is what happens, it seems select options get update but choice list “choices__list choices__list–dropdown” is not getting cleared or updated
Section does allow me to create sub section as this is dropdown is alreayd in section.
Also i used dependency field but it allows only 3 level my requirement is 5 level that is why am adding one 2 more dropdown which will populate data dynamically else will end up creating 10 different drop and hide / show them based on selection.
thank you for your clarifications - That makes things a bit trickier.
Whiche portal theme do you use? If already the new one, you could make use of end user apps.
If you wanna keep going with portal code - Where is this function called from?
Or asked differently - You know that it runs properly when changing the top dropdown?
And another question - Are the subtypes you set (“Rate Plan”,“Room Type”) part of the original dropdown options? Or are these new ones?
(“Rate Plan”,“Room Type”) are in javascript array which will be dynamically loaded in the type dropdown based on selected dropdown value different dropdown value.
I guess they need.
Because if you haven’t configured the options in Freshdesk, ticket creation will fail.
Maybe that is also the reason, that it does not allow you to set extra dropdown values.
So everything you want to see in all these dropdowns need to be configured in Freshdesk ticket fields first.
And if the dropdown is already preloaded with those values first, you only need to filter those out, which you want to remove.
nope, that is not the message I wanted to transfer.
Maybe I recap my understanding of your issue:
You have a 3-level dependent field where you want to put 2 levels more.
These 2 sublevels should also be dropdown fields and their content depends on the third level of the dependent field (or content of sublevel 4 is depending on level 3 and sublevel 5 is depending on level 4).
I hope that was summed up correctly.
If it was, I’d create either one other dependent field with 2 levels (which then are level 4 and level 5).
Or I’d create two new independent dropdowns level 4 and level 5 if another dependent field does not work for you.
In the Freshdesk ticket fields editor you would have to configure ALL dropdown options for level 4 and level 5.
And with JScript portal customization you then could react on the change of level 3, remove unwanted options and allow/enable level 4 dropdown (as it should be deactivated until a level 3 item is chosen).