CMS Select Initial State

Hi everyone. I’m using the 1 CMS as the data source for 3 different select elements. Is there a way I can specify different initial states for these 3 elements?

Hey @lenonguyen! Can you share the structure you are using? There might be a couple of ways to do this depending on the way it is setup.

Hi Luis, unfortunately, I can’t share the project link. I’m using 3 instances of the same select element that needs to have different initial values.

I’ve solved this with some custom code, but interested to know if there’s any other solutions as well.

Hey @lenonguyen! I believe custom code is the way to go in this case. Could you share it in case someone else needs the solution?

Hi Luis, here is the code I use:

   $("#select-1").val("Custom Value 1").change()
   $("#select-2").val("Custom Value 2").change()
   $("#select-3").val("Custom Value 3").change()
1 Like