Title: Populate drop-down field with javascript
Last modified: October 31, 2025

---

# Populate drop-down field with javascript

 *  Resolved [irving.bos](https://wordpress.org/support/users/irvingbos/)
 * (@irvingbos)
 * [7 months ago](https://wordpress.org/support/topic/populate-drop-down-field-with-javascript/)
 * looking for way to populate a drop down field with values found elsewhere on 
   the page . I assume it would be via JavaScript which I am totally comfortable
   with. Any specific process to follow?
 * thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [CodePeople2](https://wordpress.org/support/users/codepeople2/)
 * (@codepeople2)
 * [7 months ago](https://wordpress.org/support/topic/populate-drop-down-field-with-javascript/#post-18703126)
 * Hello [@irvingbos](https://wordpress.org/support/users/irvingbos/)
 * Thank you so much for using our plugin. Yes, that’s possible. You need only to
   call the setChoices method in the DropDown field. For example, if the DropDown
   field is the fieldname123, you can insert an HTML Content field in the form, 
   tick the checkbox in its settings to support scripts, and enter a script block
   in its content similar to:
 *     ```wp-block-code
       <script>fbuilderjQuery(document).on('formReady', function(){getField('fieldname123').setChoices({texts:['text choice 1', 'text choice 2', 'text choice 3'], values:['value choice 1', 'value choice 2', 'value choice 3']});});</script>
       ```
   
 * The getField operation returns the field’s object. The parameter of the setChoices
   method is an object with the texts and values properties whose values are the
   array of choices’ texts and values, respectively.
 * Best regards.
 *  Thread Starter [irving.bos](https://wordpress.org/support/users/irvingbos/)
 * (@irvingbos)
 * [7 months ago](https://wordpress.org/support/topic/populate-drop-down-field-with-javascript/#post-18703139)
 * thanks! I will give that a try.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Populate drop-down field with javascript’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [irving.bos](https://wordpress.org/support/users/irvingbos/)
 * Last activity: [7 months ago](https://wordpress.org/support/topic/populate-drop-down-field-with-javascript/#post-18703139)
 * Status: resolved