Glossary

What is AJAX Form Submission?

AJAX form submission is a technique that sends form data to a server using JavaScript's Fetch API or XMLHttpRequest, allowing the page to remain loaded and show success/error feedback without a full page reload.

Traditional HTML forms submit data by navigating the browser to a new page — the form's action URL. This causes a full page reload, which disrupts the user experience. AJAX (Asynchronous JavaScript and XML) solves this by sending the form data in the background while the user stays on the same page.

With AJAX submission, JavaScript intercepts the form's submit event, serializes the form data, and sends it via the Fetch API (or older XMLHttpRequest). The server responds with a success or error status, and your JavaScript code can update the UI accordingly — showing a "Thank you" message, hiding the form, or displaying error details.

The key advantages are better UX (no jarring page reload), the ability to show inline validation errors returned by the server, and control over the post-submission experience. The downside is that it requires JavaScript, which means the form won't work if JavaScript is disabled.

FormsList supports both traditional form submissions (redirects to a thank-you page) and AJAX submissions. For AJAX, set the Accept header to 'application/json' in your fetch request, and FormsList will return a JSON response instead of redirecting.

Examples

Fetch API submission

Use fetch() to POST form data as JSON, then check the response status to show a success message or error inline without reloading.

React form handler

In a React component, prevent default form submission with e.preventDefault(), send data via fetch, and update component state to show confirmation.

Progressive enhancement

Build the form with a standard action URL for non-JS users, then layer AJAX submission on top for users with JavaScript enabled.

Frequently Asked Questions

Ready to collect form submissions?

Set up your form backend in under a minute. No server required, no complex configuration — just a simple endpoint for your forms.