Support » Plugin: Advanced Forms » Pre-fill field with other field on page

  • mathijsdr

    (@mathijsdr)


    Hi guys,

    I’ve been trying to pre-fill a field in my form with data from a different ACF field on the same page. However I can’t seem to make it function properly. It’s a date picker field, however I don’t think that’s even relevant. Thank you so much in advance for helping me out.

    Best regards,
    Mathijs

    function bf_aankomstdatum_field( $value, $field, $form, $args ) {
      $aankomst = 'field_5c2cf750372e2';
      return $aankomst;
    }
    add_filter( 'af/field/prefill_value/name=aankomstdatum', 'bf_aankomstdatum_field', 10, 4 );
Viewing 1 replies (of 1 total)
  • Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi!

    When using af/field/prefill_value you should return the actual value you want your field to have, in this case a date.

    I’m not sure what you mean by an ACF field on the same page. Do you mean that your form is displayed on a page which has ACF fields attached to it?

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.