
FORMCARRY EXAMPLES
HTML Contact Form
with only Frontend Code
An HTML contact form is a form element that sends a visitor's name, email, and message to a server endpoint. Point your form's action attribute at your Formcarry endpoint and you receive every submission by email, with spam filtering, without writing any backend code. Copy an example below and start collecting submissions in 2 minutes.
HTML contact form code examples
Every tab above is a complete, working example. Pick the one that matches how you want the form to behave:
Plain HTML contact form
Point the form action at your Formcarry endpoint and the browser posts the submission, no JavaScript needed. Visitors are redirected to a thank-you page after sending.
Submit the form with fetch (AJAX)
Send the submission with the fetch() API and show a success message without reloading the page. The button is disabled while the request is in flight.
With jQuery
The same no-reload behavior using $.ajax, for sites that already load jQuery.
Native HTML form validation
Map Formcarry's server-side validation errors onto each field with setCustomValidity, then let the browser's native validation bubbles display them.
HTML contact form FAQ
Can an HTML contact form work without a backend?
HTML alone cannot send email; the form must post to a server endpoint. Formcarry provides that endpoint, so your site stays static and you write zero backend code.
How do I make an HTML form send submissions to my email?
Set the form action to your Formcarry endpoint and method to POST. Formcarry emails you every submission.
How do I stop spam on an HTML contact form?
Formcarry filters spam automatically, no CAPTCHA setup required, and supports Google reCAPTCHA for bot-heavy sites.
How do I redirect visitors after they submit?
By default Formcarry shows a thank-you page. You can set a custom redirect URL per form in your dashboard, or handle the response in JavaScript with the fetch example above and skip the redirect entirely.