DMXzone Ajax Form Support Product Page

Answered

What is the AJAX form looking for as a response to tell it that it's Success or Error?

Asked 15 Jul 2015 17:27:52
1
has this question
15 Jul 2015 17:27:52 Jake M. posted:
I created a page with an AJAX form, and it submits to a page with a MySQLi insert behavior.The MySQLi Insert works, but I don't know what the AJAX form is looking for as far as a response to show success or error.
If I have the PHP page echo back something or display any kind of text,it shows up in the error field on the AJAX form page.What should my PHP page send back to the AJAX form to tell it that it was a success or error? I've looked through the forums and manual and can't find this information.

Replies

Replied 15 Jul 2015 19:56:19
15 Jul 2015 19:56:19 Jake M. replied:
I think I found the answer to this.
As long as it returns any HTTP success code, it comes back as a success. So, if I have the insert behavior redirect to a page, no matter what page, it'll return success to the AJAX form.
If I have it redirect to a non-existent page and get a 404, for example, it'll return error to the AJAX form.
Replied 16 Jul 2015 09:09:02
16 Jul 2015 09:09:02 Teodor Kuduschiev replied:
Hello Jake, yes the ajax form returns the server HTTP error/success codes.

Reply to this topic