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.
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 reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.