Adding Forms
User input forms are an important part of many websites. However, they typically rely on server-side processing scripts. Since WebHaste renders straight HTML files, it is not able to handle form submissions directly.
The Hack: The User's Email Client
In the case of both of our starter sites, a small JS script is included to send messages from a basic contact form. This is essentially a souped-up mailto: link that opens the user's mail client and lets them send a message from there. However it's not very reliable on mobile devices.
The Better Solution: A Form Provider
Many websites need complex contact forms, email address opt-ins and surveys. There are a number of free and paid services that you can use to set up and manage these forms. The provider will give you an "embed" snippet that you can paste into your website to display the form, eliminating the need for sending mail directly from your hosting server.
Some popular form services:
Inserting the Form into Your Site
In most cases, the form provider can give you at least two options for sending users to your form:
- Link to Form — in many cases, the provider can give you a link to your form. You can simply use the 🔗 Link button to add the link somewhere in your site.
- Embed Code — most form providers can give you an "embed" snippet for displaying the form inside your site's page.
To insert a form into a page via Embed:
- Place the cursor in your page where you want the form
- Click the 🧩 Blocks button and select Misc Embed
- Switch to Code view and find the line with the example iFrame. Replace this with the code from your provider.