Support

Account

Home Forums ACF PRO how to change value in select box?

Helping

how to change value in select box?

  • Using javascript I can programmatically change the value of a text field using:

    $('#acf-field_5592bee09c77d').val( "some value" );

    and for check box using:

    $('#acf-field_558e8b3bbc0f4-Option1').prop( 'checked', true);

    But how can I change the value of a drop down list box (UI stylized).

    I’ve tried all sorts of combinations but can’t work it out!

    Is there perhaps a list of these methods somewhere?

  • Not sure if this will help you or not, but what you need to find is how to change the selected value in a select2 field and then work out how to alter it to make it work in ACF. This looks promising. http://stackoverflow.com/questions/19639951/how-do-i-change-selected-value-of-select2-dropdown-with-jqgrid. I do know that you might need to target the hidden field, but that’s just a guess.

    There isn’t any list that I know of that explains how to get or set values in all of the different ACF field types.

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

The topic ‘how to change value in select box?’ is closed to new replies.