Support » Plugin: Advanced Forms » dynamically populate select list

  • Resolved georgedk4

    (@georgedk4)


    Hi,

    I am trying to use the following filter to dynamically populate a select list (af/field/prefill_value) but it is not working. This is the code i have:-

    [CODE]
    function prefill_form_field( $value, $field, $form, $args ) {
    $field[‘choices’] = array(‘key_1’ => ‘value 1’, ‘key_2’ => ‘value 2’);
    return $field;
    }
    add_filter( ‘af/field/prefill_value/key=field_5fc7aec97ca22’, ‘prefill_form_field’, 10, 4 );
    {/CODE]

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘dynamically populate select list’ is closed to new replies.