Forms — Lookis HTML
The Lookis HTML template has one form, the contact form on the Contact page, and it sends to the form service or webhook of your choice.
The form checks the required fields, shows a spinner while sending, says “Thank you” 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 it runs in demo mode: nothing is sent, and the fields are logged in the browser console. Pick a destination before you publish.
Connect a form service
Section titled “Connect a form service”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: Google Sheets, Slack, a CRM, your booking tool | The webhook (“catch hook”) URL |
-
Create a form at the service and copy its endpoint.
-
Open
assets/js/config.jsand paste it:window.siteConfig = {formEndpoint: "https://formspree.io/f/abcdwxyz",formAccessKey: "", // Web3Forms only}; -
Serve the folder (
npx serve .), send a message from the Contact page and check that it arrived. -
Upload
config.jswith the site.
Every page loads the same config.js. The sample forms in style-guide.html stay in demo mode whatever you set there
(they carry data-form-demo), so they never send anything.
What the service receives
Section titled “What the service receives”Each field by its name, as multipart/form-data:
| Field | Name | Required |
|---|---|---|
| Name | name |
|
email |
yes | |
| Message | message |
yes |
The form also sends form (contact) and subject (“New message from the Lookis contact form”), so you can tell its
messages apart in your inbox or tool. With formAccessKey set, it also sends it as access_key. The honeypot field is
left out. The request asks for a JSON answer (Accept: application/json), so the service answers the page instead of
showing its own thank-you page.
Changing the fields
Section titled “Changing the fields”The fields are ordinary <input> and <textarea> elements inside the <form data-form> of contact.html. They carry
no visible label, as in the original design: each shows a placeholder (“Your Name”, “Your Email”, “Your Message”) and is
named for screen readers with aria-label. Change both when you change a field’s wording. Name and Email sit side by
side from tablets up (one column on phones); the message and the button take the whole width (md:col-span-2).
- To make a field required, add
requiredto it. The browser checks it before sending. - To add a field, copy an
<input …/>, give it a newname,aria-labelandplaceholder. The service receives whatever the form contains, so there are no settings to update. Don’t name a fieldfax: it is the honeypot’s. - To remove a field, delete its element.
A field arrives under its name, so keep the names you already map somewhere. The button’s texts are written in the
button: “Submit” twice (the second copy is read while the form is sending), “Thank you” and “Something went wrong”.
“Thank you” and “Something went wrong” are also in the form’s data-success and data-error, which screen readers
announce: change both. The title of each submission is the value of the hidden subject field: put your own name in
it.
To send visitors to a page of your own after a successful send, add data-redirect="thank-you.html" to the <form>.
Testing before launch
Section titled “Testing before launch”- Send a message from the live site with a real address, and reply to the test.
- The service must answer with a success status (2xx). If it doesn’t, the visitor sees “Something went wrong” and keeps
what they typed. Try it once by pasting a wrong endpoint into
config.json your local copy. - The browser console tells you what happened: in demo mode it logs
[forms] demo mode — set formEndpoint in assets/js/config.js to send submissionswith the fields; after a failure,[forms] could not send the formwith the reason.
Spam and privacy
Section titled “Spam and privacy”The honeypot stops the usual bots: the 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. The services above filter spam on their side as well. The endpoint
is visible in the page source, which is how these services are designed to work.
Submissions go only where you point them. Most countries expect you to say what happens to the data people send you (here a name, an e-mail address and a message). Lookis has no consent checkbox and no privacy page: add one if your visitors need it (Editing the site).