A simple contact form example using plain HTML, CSS, and JavaScript with Formbase.
Formbase is a form backend service that handles form submissions for you. No server code needed - just point your form to Formbase and receive submissions via email or webhooks.
-
Clone this repository:
git clone https://github.com/formbase-dev/formbase-html-example.git cd formbase-html-example -
Configure your Form ID:
- Sign up at formbase.dev and create a form
- Copy your Form ID
- Open
index.htmland replaceYOUR_FORM_IDwith your actual Form ID
-
Open
index.htmlin your browser or serve with any static file server:# Using Python python -m http.server 8000 # Using Node.js (npx) npx serve
- User fills out the contact form (name, email, message)
- On submit, the form data is POSTed to
https://formbase.dev/s/{YOUR_FORM_ID} - Formbase processes the submission and sends you a notification
- User is redirected to a thank-you page
├── index.html # Home page with contact form
├── thank-you.html # Success page after submission
├── README.md
└── LICENSE
Add new input fields in index.html:
<div>
<label for="phone">Phone</label>
<input type="tel" id="phone" name="phone" />
</div>This example uses Tailwind CSS via CDN. Modify the classes on any element to change its appearance, or replace with your own CSS.
- HTML5
- JavaScript (Vanilla)
- Tailwind CSS (via CDN)
- Formbase - Form backend service
- Formbase Documentation
- Other Formbase Examples
MIT