Home Forums Front-end Issues Set selected value


Set selected value

  • Hello,
    is it possible to set a default value in a multiple select (post object source) on a event (ex. onclick a js function calculate a value. This value is the option to set as selected)?

    I think to use acf.add_action(‘show_field’, …. to get value to set as selected. It works.
    But i don’t now how to set it.

    Thanks in advance.

  • Do you think it is possible to manipulate args directly with javascript with something like:

    jQuery('#acf-field-5923eb94b4a28').select2().val('some value').trigger('change');

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

You must be logged in to reply to this topic.