Advanced Custom Fields
Filling fields with Javascript (1 post)

  1. chriscatfr
    Posted 2 years ago #

    I'm using the latest version (ids has changed lately) 4.0.3.

    And I fill the custom fields automatically with Ajax.

    I add new posts with the following kind of URL

    then AJAX load the custom fields values that I copy to their fields with the following JS:
    jQuery('#acf-field-email').val( question_array['email'] );

    It works fine, except that I can't find which Javascript function is used for Images. I have a custom field for an image, my ajax provide me with the ID and SRC for thumbnail.

    For dates I ended up using a text custom fields too. But it's not that disturbing.

    Could you tell me how to fill this image custom field please?
    <div id="acf-attached_file_id"...

    I wish I could use the following JS line:
    auto_insert_image( question_array['attached_file_id'], question_array['attached_file_src'] );


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic