Home Forums ACF PRO insert values into fields programmatically Reply To: insert values into fields programmatically

  • You can target specific fields by using something like this

    $('.acf-field[data-key="field_0123456"] input[type="email"]')

    field_0123456 represents your field key.

    As far as getting the value from the field, every field is going to be a little different. For example, a WYSIWYG field is a standard WP tinyMCE field and you’re going to need to look into how to get the value from that field. Other ACF fields will need to be look at on a one by one basis, but you can target specific fields with actions and to get values using the same basic method that I gave above by using the field keys. Updating other fields in the form is going to be the same as getting values from fields, each one is going to require different code depending on what type of field it is.

    I have some examples of getting values from some types of fields and updating values is some types of fields, but I don’t have them all figured out. You can see my examples here