• Resolved Andrew Steelsmith

    (@captaindrew80)


    I’m playing around with the form and was curious how to prepopulate the fields with the ACF values of the post where the form is located. I want to allow the user to edit CPT ACF values from the front end. Is this the wrong way to go?

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback. Are you using the ACF Extended Form UI? If that’s the case, well it’s pretty easy, you just have to add a “Post Action”, and head over the “Load” tab.

    Once you enabled the “Load values” switch, you’ll be able to set which source should be used to load values from. In your case, it’s the default source, “Current: Post”.

    You can now map fields to tell which one should contain the current Post Title, current Post Content, current Post Status etc… Just choose the field in the related select input. You’re not forced to map those fields, but in most case you’ll want to load post title & content for example.

    For custom ACF Fields (which have to load ACF meta values, and not post values), you’ll find a checkbox list with all fields at the bottom of the “Load” tab, it’s called “Load ACF fields”. Just select which fields should have their meta value loaded.

    Here is a configuration example: https://i.imgur.com/PGrqRpA.png

    In this example, I have a field group with 3 fields:
    – Post Title
    – Post Content
    – My ACF Field

    Post title will be used to load post title, Post Content to load post content, and ACF field will have its meta value loaded. All based on the current post, where the form is being displayed on.

    Hope it helps.

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Prepopulate Form With Values’ is closed to new replies.