After adding JS, dropdown options not configurable

Okay, this seems pretty odd, but I tried a zillion experiments. After creating a new list, and a new dropdown element, I added 3 options and then added some JS to show/hide another group in the form if one of the dropdown options was selected. That all worked fine, but I found that any subsequent changes to the list of dropdown options was not properly respected. Changing the default option no longer responded. Changing the order of options no longer responded. Changing the value for the option whose value was mentioned in the JS did cause the options ot present correctly. Changing it back to the original value mentioned in the JS caused the option to always be presented first, regardless of default or order settings for the option. Getting rid of the JS didn't change things. The only way that I could find to make the options list present as ordered was to change the value expected for the option that was now different from the value that had been mentioned in the JS. Ultimately, I deleted the element and created a new one where I fully configured the options before adding the JS.

Steps to replicate:
1) create a dropdown and add some options including one with a value of FB
2) add some JS to the dropdown so that a group on the form will show if FB is the value or hide if FB is not the value
3) add more options to the dropdown and change the order of the options

Expected behaviour: The option order changes as configured

Actual behaviour: The option which has the value of FB is always shown first regardless of default or order settings.
 
Thom, I just tested this on my site and am not experiencing the behaviour you are. Moving options, adding options etc all still maintain the correct JS actions. I think you will need to try again but watch the developers console for any errors.
 
Well, today, I can't replicate this issue. After reporting this issue, I deleted the problematic element, I created a new one exactly like it, only I was careful to add all the options in the correct order so I wouldn't run into the issue. Today, I tried playing with the dropdown options and all changes worked normally.

The only thing I can think of that might be different is that, in the original, I had initially written in my own JS (because I forgot about the predefined js options.). After I remembered that I could use predefined js, I switched to using one of the predefined scripts. Perhaps I left some code in the code field. I noticed today that any code left in the code field can cause errors when you are using a predefined script.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top