Home › Forums › General Issues › Load pre-defined values for fields? › Reply To: Load pre-defined values for fields?
Hi @herrfischer
Hmm.. I suppose you could do this by adding some custom JS to the page.
Basically you’ll save some site meta information containing these default presets (in wp_options).. perhaps that’s something you should do on activation of the theme but I leave that up to you.
Then, when a person clicks one preset button you run some javascript that does an ajax call and fetches the preset information (get_option()
). Then you’ll simply input those values into the input fields within ACF using javascript..
jQuery('#inputfield').val(ajaxresponse.farbeA);
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.