CF7 prints a “0” after ajax submit
-
Hello!
Please, maybe you have idea & lead me closer to solution:
My problem: i’m trying to set up the CF7 form to work properly in a WP page with my custom ajax navigation. Seems, i broke something. Can’t find the bug for a while.
The form works just perfectly after the initial pageload. But, after clicking the nav buttons (my custom- ajax part does the job here), CF7 breaks after submit and prints a “0” as output (with the url: /admin-ajax.php#wpcf7-f409-o1 ) –> so i guess the problem is something like: cf7 form can’t get some crucial data from my ajaxified page.You can test it here. Please follow these steps to replicate the issue:
1. open the page from this link. https://maef-hu.iwanwilaga.com/fotosaink/ancsin-attila/
2. click on the left or right (nav) buttons on the sides. That switches the content to the “prev” or “next” page. (this is the custom ajax part by me.)
3. Now click on the blue button below the social icons. The form area turns visible below that.
4. Submit a form. (Name, Email, Message).
5. Form prints a “0” on the “/admin-ajax.php#wpcf7-f409-o1” url. (so i guess it’s some kind of ajax communication problem related to the form)
extra info: when you click on a nav button, ajax asks for the prev or next page accordingly, server runs a new query and sends data back to jQuery to populate the page with the changed elements of the received post object, also it sends the re-generated cf7 form html markup).
I tried to output the cf7 form either with “echo do_shortcode( ‘[contact-form-7″….
and also with wp_send_json(), but both gave me the same “0” result.) In both cases the form displays properly, but as you find, the Submit part is broken.Thank you for any hints, would be much appreciated, man!
The page I need help with: [log in to see the link]
- The topic ‘CF7 prints a “0” after ajax submit’ is closed to new replies.