Home › Forums › General Issues › Auto increment number field from front end button › Reply To: Auto increment number field from front end button
I can’t give you an exact answer, but I can point out the areas which are most likely to cause an issue.
Firstly. Please debug your code. It is a simple and effective way to find and solve code issues.
1. Does your click event work?
2. Do all JS variables exist? ie. ajaxurl
3. Have you checked your AJAX response in the console log? Any errors?
4. Is DEBUG MODE turned on to show PHP errors?
5. global $post wont work within an ajax call
6. You need to pass the post_id as a variable within data
7. Don’t use get_post_custom
8. Do use get_field
9. Debug your PHP code line by line and make sure it is running correctly.
Thanks
E
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’re working hard on Advanced Custom Fields PRO 6.0, and Beta 1 is now available 🚀
— Advanced Custom Fields (@wp_acf) August 12, 2022
Featuring improved performance for Repeater fields with large datasets, and a new generation of ACF Blocks.
Let’s take a look 🧵https://t.co/Befre3kFAo
© 2022 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.