Home › Forums › Backend Issues (wp-admin) › AJAX button
I want to add a button to a metabox that when pressed, executes an AJAX script.
I can’t find anything on how to add an unattached button field.
Hi @dnavarrojr
Thanks for the question.
Kindly explain with more detail what you mean by an unattached button so that I can see how I may be of help.
Hi @photocurio
Thanks for chipping in.
Maybe you could offer more details on your desirable functionality so that I can compile a conclusive report for the plugin author.
Sorry, been been extremely busy at work.
This is probably more for an ACF addon that a feature, but in order to add code associated with any ACF field, you have to add it to FUNCTIONS.PHP or a custom plugin.
I’d really love to see an additional section for each field that allows me to plug my code right into each individual field’s settings.
So, I can stick some JS code that handles validation or loading data from an external source, or updating other fields in the metabox.
For example, I have an ACF form for handling basketball brackets. And I’d like to display an update to the bracket in an HTML field each time a game is added. Right now, you have to add the game, update, then view the bracket on a front end page. Very time consuming.
It would also be nice to attach PHP code to a field that is executed each time the field is updated. Again, I can write code in my custom plugin, but maintaining it all gets to be a hassle when it would be so much easier if it were right there as an added section for each field.
Hi @dnavarrojr,
Apologies for the delay, the forums are unmonitored by the developer.
To help us begin some work on this, please open a feature request at [email protected] and our friendly support team will get back to you ASAP 🙂
The topic ‘AJAX button’ is closed to new replies.
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.