A5.form.populateSelect Method

Do not use this method to populate a dropdown box in a UX or Grid Component. Use {dialog.object}.populateDropdownBox or {grid.object}.populateDropdownBox instead.


A5.form.populateSelect(eleId, curValue, data, clearExistingEntries);



The ID attribute of the select control.


The value to show as selected when the control is populated. If it is specified, the control will not show any "blank" or empty option. If it is not specified (value = ""), a blank option will be shown at the bottom of the list of options.

dataobject array

The list of values used to create the option list.


A true/false value. If true, it clears any values in the select control on the page before creating the new list. If false, it does not clear the list. In most cases, clearExistingEntries should be set to true.


Populates a dropdown box.


Select boxes or dropdowns are common controls on a page. This function allows populating a dropdown with values from a callback page.

There are four required input parameters:

  • eleId
  • curValue
  • data
  • clearExistingEntries

'data' can be an array of single values such as:


When the list is created the display value and the saved value will be the same. This would be equivalent to:

< select name="states">
     < option value="AL">AL</option>
    < option  value="MA">MA</option>
    < option  value="TX">TX</option>
    < option  value="VA">VA</option>

However, it is often desired to show one value, but select another. The saved value may be a state code, but the display may be the full state name. If the an entry in the array is itself an array, then the first value in the array will be the displayed text, and the second will be the returned value. The following array would create the equivalent select options listed below:


< select  name="states">
    < option value="AL">Alabama< /option>
     < option value="MA">Massachusetts< /option>
    < option  value="TX">Texas< /option>
    < option  value="VA">Virginia< /option>
< /select>

The full code to set a SELECT with an ID of "Bill_State" to a VALUE of "MA" using the list of states above, and removing any old entries from the SELECT would be: