Support

Account

Home Forums Front-end Issues Saving acf_form() via AJAX – maybe it can be done? Reply To: Saving acf_form() via AJAX – maybe it can be done?

  • Hi John,

    Thanks, I was able to hook acf_form_head into:

    wp_localize_script( 'csm-csf', 'acf_form_head', array( 'ajaxurl' => admin_url( 'admin-ajax.php', 'http' ) ) );
    add_action( 'wp_ajax_nopriv_acf_form_head', 'acf_form_head' );
    add_action( 'wp_ajax_acf_form_head', 'acf_form_head' );

    And pass it data via ajax and get a response. Looks like building out the data for basic form elements is easy enough, but repeater fields and select2 off screen fields are going to take some work.

    But I’ll look at other links you provided. Thanks!