简体   繁体   中英

Nothing happens when clicking submit

I'm using WordPress with Custom Content Types plugin. I have the code in a PHP file which creates a contact form.

The website is http://schools.raci.org.au/competition/ancq/

It was working fine before I migrated it to a new host. I didn't write the original code, so I don't really know how it works.

Here are the relevant files:

Here is the code for the main page: pastebin.com/piaTSVgc

and the code for the form: pastebin.com/xeqsmc5g

here is admin-ajax.php: pastebin.com/eFx2JFJu

here is the function where register_interest_form lives: pastebin.com/knrChkSP

here is functions.php: pastebin.com/hru5LkQR

Thanks in advance!

Its working from.

When we submit form. there is ajax request is been processing and getting 0 in response.

The default response from admin-ajax.php is,

die( '0' );

...by adding your own exit() or die() after returning your desired content prevents the default response from admin-ajax.php being returned as well.

The solution is to add die() to the end of your own ajax function, so you die the script before die('0')

It also generally means that your ajax call has succeeded.

Ultimately, to answer your question, it's meant to work this way. What you are doing by exiting after returning your content is the right thing to do.

details from.

https://wordpress.stackexchange.com/questions/116759/why-does-wordpress-add-0-zero-to-an-ajax-response

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM