Have a calculated dropdown box default to top option when clicking away from dropdown
I am having issues with a calculated dropdown box. The dropdown box (D2) is being calculated based off of the value of another dropdown (D1) on my form. For example, if D1 = "View Only" then the options in D2 should be "Does Not Need View Only" or "Needs View Only". I have been able to accomplish this via a calculated javascript (below for reference).
However; my issue is when I make my selection in D2 and I click away from the dropdown box it automatically defaults to the top of the list (i.e. If I select "Needs View Only" in the drop down and click away it will jump back up to "Does Not Need View Only"). I am pretty sure it is an issue with one of the properties of the dropdown but cannot figure out which one. I have played around with the Sort items and Commit after selected flag on the options tab of the properties with no help. If needed I can send screenshots of my current configuration of the dropdown properties. Any help would be greatly appreciated!!
Javascript :
if (event.value=="View Only") this.getField("D2").setItems(["Does Not Need View Only", "Needs View Only"]);
