Form examples

Try common form patterns in your browser and copy the code to your project.

A simple contact form

A compact inquiry form with a name, an email, and a message.

HTML

Contact form with inline feedback

An asynchronous submission keeps visitors on the contact page while showing its progress.

JavaScript

Two-step recommendation score

Collect a recommendation score and an optional explanation in a short survey.

JavaScript

Two-step discovery survey

Ask about a project first, then collect an email for the follow-up.

JavaScript

Contact form with constraint validation

Combine required fields and browser validation with an inline submission result.

JavaScript

Contact dialog

Keep the form available behind a Contact button on a busy page.

HTML and JavaScript

Small feedback panel

Collect a short note from anywhere on your site without leaving a form visible all the time.

HTML

Contact form with a supporting file

Collect a document or picture alongside a message when attachments are configured.

HTML

Contact form with drag-and-drop attachments

Let visitors browse for files, drop them, and review their selection before sending.

JavaScript

Contact form with a responsive grid

Fit short fields across two columns when there is room and stack them on mobile.

HTML and CSS

Contact form with phone formatting

Format US and Canadian phone numbers after typing, without interrupting the cursor.

HTML and JavaScript

Contact form that follows the system theme

Let the form adapt to a visitor’s system appearance.

HTML and CSS

Unstyled email and message form

The fewest moving parts needed to accept a simple message.

HTML

Contact form with a CAPTCHA check

Add a Google reCAPTCHA v2 checkbox to a contact form on your website.

Spam controls