Skip to content
Sign inJoin waitlist

Forms — Fitbricks HTML

The Fitbricks HTML template has three forms, and they send to the form service or webhook of your choice: the contact form, the free-trial form and the booking form of every club.

“Get in Touch” is on Contact, “Claim Free Trial” on Free Trial, and “Book Your Class Now” in the sidebar of each of the 30 club pages. Each form checks its fields in the browser, shows a spinner on its button while sending, says “Thank you” on the button and clears the fields, keeps what the visitor typed when something fails (“Something went wrong”), and drops spam with a hidden honeypot field.

Out of the box they run in demo mode: nothing is sent, and the fields are logged in the browser console. Pick a destination before you publish.

A static site has no server of its own, so submissions go to a form service or a webhook. All of these have a free tier:

Service What it does formEndpoint
Formspree Emails you each submission https://formspree.io/f/<form id>
Web3Forms Emails you each submission, no account needed https://api.web3forms.com/submit, and your key in formAccessKey
Getform, Basin Inbox, email, integrations The form’s endpoint URL
Zapier, Make, n8n, Pipedream Send submissions anywhere: your inbox, a CRM, a booking tool, Google Sheets, Slack The webhook (“catch hook”) URL

With a webhook you can route each form by its form field: free-trial requests to your sales team, bookings to the club, messages to your inbox.

  1. Create a form at the service and copy its endpoint.

  2. Open assets/js/config.js and paste it:

    window.siteConfig = {
    formEndpoint: "https://formspree.io/f/abcdwxyz",
    formAccessKey: "", // Web3Forms only
    };
  3. Serve the folder (npx serve .), submit each form (a contact message, a free-trial request, a booking from a club page) and check that the submissions arrived.

  4. Upload config.js with the site.

Every page loads the same config.js, so one endpoint serves the three forms. The sample form in style-guide.html stays in demo mode whatever you set there (it carries data-form-demo), so it never sends anything.

Each field by its name, as multipart/form-data, plus form and subject, which tell the forms apart.

The contact form on Contact (form: contact, subject “Get in Touch”, button “Submit”):

Field Name Required
Name Name
Email Email yes
Phone Phone
Contact Time Preferences (Morning, Afternoon, Evening, Night) Contact Time yes
Message Message

The free-trial form on Free Trial (form: free-trial, subject “Claim Free Trial”, button “Submit”): the same fields as the contact form, plus two choices:

Field Name Values
Preferred Location City One of the ten cities
Preferred Class Class One of the first ten programs

The booking form on every club page (form: booking, subject “Book Your Class Now”, button “Book Now”):

Field Name Required
Name Name
Phone Phone
Email Email yes
Club Location (filled in with the club’s name) Club
Preferred Date Date (YYYY-MM-DD)
Preferred Time Time (HH:MM)
Additional Notes Message

The e-mail and the contact time are required (the original design required only the contact time); an e-mail that doesn’t look like an address is refused without sending. If the service answers with an error, the form shows “Something went wrong” and keeps what was typed.

The forms are plain HTML in the pages: a <form data-form> in contact.html, free-trial.html and every page in club/. Their messages are attributes of the form (data-success="Thank you", data-error="Something went wrong", data-submit-label="Submit"), and each field is a <label> holding its text and an <input>, <select> or <textarea>.

  • To make a field required, add required to its <input> or <textarea>; to make the contact time optional, remove required from its <select>. The browser then asks for the field before sending.
  • To add a field, copy a <label>…</label> block, and change its text, the name, the placeholder and the type (text, email, tel, date), or copy the message’s block for another text area.
  • To change the choices of the free-trial form, copy or delete a radio’s <label> in its group and change its value and its text; keep the group’s name (City, Class). The cities and classes are written out, so a new club city or program doesn’t appear there by itself.
  • To remove a field, delete its <label> block.
  • Keep the hidden form and subject inputs, and don’t give a real field the name fax: it is the honeypot’s (Spam and privacy).

The booking form is copied into all 30 club pages: change it with find and replace in files (Editing the site), and keep each club’s own name in its “Club Location” value.

  • Submit each form on your own site after uploading, with a real address, and check the destination.
  • Reply to the test message.
  • Try a failure on purpose: a wrong endpoint, submit, and confirm the visitor sees “Something went wrong” and their text is still there.

The honeypot stops the usual bots: every form carries a hidden field named fax that a person never sees; a bot that fills it is shown “Thank you” and nothing is sent. Form services filter spam on their side too; turn on their captcha if spam still gets through.

Submissions go only to the endpoint you set; the site itself stores nothing. The forms collect names, e-mails and phones: make your Privacy Policy say how you handle them and which form service receives them. The legal pages in the download are samples written for the made-up Waras gym (Editing the site).