For the complete documentation index, see llms.txt. This page is also available as Markdown.

Form

Build forms that submit to email or a webhook

The Form component is the wrapper for fields, attachments, feedback, and submission controls. It validates its fields, then sends the submission through an SMTP email account or to a webhook.

How to Build a Form

You’ll find Form and its related components under Forms in the Components list.

  1. Drag Form onto the page.

  2. Add Input, Date Picker, Select, Checkbox, Radio, Attachment, and Label components inside the Form.

  3. Add a Submit component inside the Form.

  4. Drag a clickable component—normally a Button—into the Submit component’s drop zone.

  5. Add Success and Error components, then place the feedback content you want to show inside them.

  6. Choose Email or Webhook delivery and enter the required connection details.

  7. Configure spam protection if needed.

  8. Publish to a PHP-enabled server and test a complete submission.

Form Components

All form controls must be inside the Form wrapper.

Component
Purpose

Attachment

Accepts one or more uploaded files.

Checkbox

Collects zero, one, or several choices.

Date Picker

Collects a date and optional time.

Error

Displays custom content when form submission fails.

Input

Collects text, email, numbers, passwords, search terms, telephone numbers, URLs, or multi-line text.

Label

Associates visible descriptive text with a field.

Radio

Lets visitors choose one option from a group.

Select

Presents a drop-down list of options.

Submit

Turns a child Button or similar component into the form’s submission control.

Success

Displays custom content after a successful submission.

Compatibility Checklist

Before publishing:

Component Settings

Settings

Type is not responsive and defaults to Email.

  • Email — Sends through the configured SMTP account.

  • Webhook — Sends to the URL entered under Webhook URL.

Webhook reveals Webhook URL, which is blank until configured.

Email Authentication

Email delivery reveals:

  • Host — SMTP hostname. The placeholder is smtp.example.com.

  • Port — Defaults to 587.

  • Encryption — None, TLS, or SSL. TLS is the default.

  • Username — SMTP account username, commonly the full email address.

  • Password — SMTP account password or provider-specific app password.

Replace every example value before publishing.

Email delivery is powered by PHPMailer.

We recommend a webhook when you do not need direct SMTP delivery. Webhook services often provide clearer logs, retries, and integrations with databases, spreadsheets, CRMs, and automation tools.

Email Settings

  • From Name — Name shown as the sender.

  • From Address — Sender address. It should normally match the SMTP account and its domain.

  • Subject — Defaults to “New Form Submission”.

  • To Name — Recipient name.

  • To Address — Address that receives the submission.

Use an authenticated address as From. Do not use the visitor’s address as From; use the email field for Reply-To.

Email Template

Template Style defaults to Default. Options are Default, Table, Simple, and Modern.

Email Title defaults to “New Form Submission”.

Email Footer is blank by default.

SSL Configuration

  • Verify Peer — Enabled by default.

  • Verify Peer Name — Enabled by default.

  • Allow Self-Signed — Disabled by default.

Spam Protection

Service is not responsive and defaults to None.

  • None

  • reCAPTCHA

  • Turnstile

  • hCaptcha

  • Honey Pot

Honey Pot adds hidden fields that help identify automated submissions and needs no external keys.

reCAPTCHA, Turnstile, and hCaptcha reveal:

  • Style — Visible or Invisible. Invisible is the default.

  • Site Key

  • Secret Key

Obtain the keys from the selected provider and make sure they are authorised for the published domain.

Errors

Invalid fields default to Red 500 Background and Border colours. Their validation message defaults to Red 50 text.

These colours style invalid controls. Add the Error component when you also want a custom form-level error message.

Success

On Success is not responsive and defaults to Success Content.

  • Success Content — Shows the content inside a Success component.

  • Redirect — Reveals Link and sends the visitor to that destination.

Reset is enabled by default and clears the form fields after a successful submission.

Reply-To Address

Name the visitor’s email Input exactly:

The name is case-sensitive. Keep the authenticated account in From Address; the submitted email value becomes Reply-To.

Webhooks

A webhook sends the submission to another service, such as a database, CRM, automation tool, or server endpoint. Services such as Zapier, Make, and Pipedream can use it to:

  • Add leads to a database or spreadsheet.

  • Send follow-up email.

  • Notify a team.

  • Create tickets or tasks.

Webhook attachments are limited to the first attached file. Email delivery supports multiple files when Attachment has Multiple enabled.

PHP Server Check

Append ?apicheck to the published URL of a page containing the Form:

The page reports whether the Forms API is reachable and shows the server’s PHP version.

Testing Webhooks Locally

The normal Elements preview is not a PHP server. To test against a local server:

  1. Install a local PHP environment such as ServBay.

  2. Publish the Elements site to a local folder.

  3. Point the local server at that folder.

  4. Open the server URL in a browser and submit the form.

Troubleshooting

The form does nothing when clicked

Confirm that a Button or other clickable component is inside Submit, and that Submit itself is inside Form. The empty Submit wrapper cannot be clicked.

The form works visually but sends nothing

Publish to a PHP-enabled server, run the PHP Server Check, and confirm that the server supports outbound SMTP or can reach the webhook URL.

SMTP authentication fails

Check Host, Port, Encryption, Username, and Password with the email provider. Remove accidental spaces. Make sure From Address is permitted by the authenticated account and that the SMTP certificate matches the Host.

Providers such as Fastmail may require an app password. See Using Fastmail.

If the settings look correct but delivery still fails, search the Elements Forum for advice about your email provider or hosting setup.

Required fields are not accepted

Make sure each field has a valid Name and that Checkbox, Radio, and Select options have non-empty values. Test the published form using the same path a visitor will follow.

Finding form logs

The published Forms API stores logs inside its api/logs directory. Files use a form-specific name and date; check the newest file created after the failed test.

Accessibility

Use a visible Label for each field, preserve keyboard focus outlines, identify required fields in visible text, and make Error and Success messages understandable without relying on colour alone.

Common Control
Description

Link

Link to a page, resource, anchor, email address, or website.

Layout

Control positioning, stacking, visibility, overflow, and isolation.

Sizing

Set width, height, and responsive size constraints.

Spacing

Add responsive margin and padding.

Typography & Text Styles

Control fonts, text spacing, decoration, colour, and semantic wrappers.

Backgrounds

Apply colour, image, gradient, SVG, video, and hover backgrounds.

Transitions

Choose what animates and set its timing curve, duration, and delay.

Effects

Apply shadows, opacity, and hover effects.

Filters

Apply blur, brightness, saturation, shadow, and backdrop effects.

Transforms

Scale, rotate, move, and skew components.

Borders

Set border style, colour, opacity, width, radius, and hover states.

Advanced

Add CSS classes and IDs, or change supported HTML tags.

Last updated

Was this helpful?