Support

Account

Home Forums General Issues Auto increment number field from front end button Reply To: Auto increment number field from front end button

  • Hi @chrismitchell

    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