Assigning a default value to a combo box form field
Copy link to clipboard
Copied
Looking for a sample script to assign/change a default value for a combo box used to assign the value to a combo box subsequent to using the resetForm() method.
Copy link to clipboard
Copied
No need to answer. Resolved.
Copy link to clipboard
Copied
I stand corrected in that the script I had created failed to accomplish the task at hand in which case I also need to rephrase the initial question. The issue I am having is that I would like to prevent the default value of a combo box from changing whenever a user adds a value to the drop down list. While I have created scripts that work flawlessly to allow an end user to add as well as delete an item to/from a combo box, I have yet been able to create a script that retains and prevents a default value from changing whenever a user adds a new value to the drop down list. A script appears to be required since any time a user adds a new value to the list, the default value for the combo box automatically shifts to the top most item in the list. Any suggestions regarding the solution are most appreciated. Thank you ahead of time.
Copy link to clipboard
Copied
Resolved. Sorry to be a PITA. The script was correct and simple as I had initially thought. It was essentially the placement inside another script causing the problem.
Copy link to clipboard
Copied
Just for anyone else who finds this thread, the answer is the default item is the first one that appears in the array you supply to the setItems method as a parameter.
Copy link to clipboard
Copied
Understood. In my particular case, the resolve was to implement a script to retain the same default item in a combo box such as 'Select|Add' whenever resetting the form, adding, or deleting an item from a combo box when using a custom popup menu integrated into the form.

