An option appears twice in a choice list


Description

After writing a custom script, an option desired to be the default choice, appears twice in a choice list.

Cause

The issue is that the value passed in the Client Script was the Field's Label rather than the Value. This caused a perceived duplicate choice.

Resolution

For example, replace all occurrences of

g_form.setValue("time_constraint","Start on specific date");


with

g_form.setValue("time_constraint","start_on");


as the value of the choice is actually 'start_on' (while 'Start on specific date' is just the label).