See Form Submit Results

Seeing an error similar to this ...  ?

SyntaxError: Unexpected token ... is not valid JSON

Sometimes you may get a "JSON" error when submitting your form. This usually means there was an error that was not in JSON format . To see what the error actually is, you can use the browser's Developer Tools.

The browser Developer Tools may seem a bit overwhelming at first, but don't worry, I'll guide you through the steps to see what result is being returned from a remote web server using XHR (Ajax). For this example, I'll be using Google Chrome, but most modern browsers have similar developer tools.


Follow these steps to see what result is being returned:

Step 1: Open Developer Tools Open the developer tools in your browser using one of the methods mentioned earlier.

Step 2: Switch to the Network Tab Navigate to the "Network" tab in the developer tools.

Step 3: Enable XHR (Ajax) Filtering Enable the filtering option to show only XHR (Ajax) requests in the network panel.

Step 4: Submit the Form Fill in the required fields in the form on the web page. Then, click the submit button to send the form data to the remote web server.

Step 5: Observe XHR Request in Network Tab As you submit the form, you should see a new entry appear in the network tab. This entry represents the XHR request made by the browser to the server.

Step 6: Inspect XHR Request and Response Click on the XHR entry to inspect its details.

  • Check the "Headers" tab to see the request headers, including the form data that was sent to the server.
  • In the "Preview" or "Response" tab, you'll find the server's response. This could be a success message, an error message, or any data returned by the server.

Step 7: Troubleshooting (if needed) If the XHR request didn't go through successfully or the response doesn't seem as expected, you can use the information in the developer tools to help troubleshoot the issue. Check for any error messages in the console, review the request headers, and ensure the form data is being sent correctly.

By following these steps, you'll be able to see what result is being returned from the remote web server after submitting the form using XHR (Ajax). Remember that the names and specific locations of tabs may vary slightly based on the browser you're using, but the overall process should be simil

Have more questions? Submit a request


Article is closed for comments.
Powered by Zendesk