Home › Forums › Front-end Issues › Pre-fill acf_form fields based on query parameter › Reply To: Pre-fill acf_form fields based on query parameter
I actually ended up going in a different direction. Since I only needed one post to be the Related post, I changed the field type from Relationship to Post Object. From here, when the page loads with the aforementioned query tags, I use javascript to set the value of #acf-field_<number>-input field to the post_id of the parent. Then, when saving, it properly sets the parent post.
This is a bit hackish, but does what I need it to.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.