HTML forms

This page covers a plain HTML form: the markup it needs, the field names with a special meaning, where the browser goes afterwards, and the limits.

Last updated

The form

A form needs three things: method="POST", the submit address as its action, and a hidden access_key field with your form's key. Every other field is yours to name.

<form action="https://submit.formrelay.domodomu.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New enquiry from the website">
  <input type="hidden" name="redirect" value="https://example.com/thanks">

  <input type="text" name="name" required>
  <input type="email" name="email" required>
  <label><input type="checkbox" name="interest" value="Design"> Design</label>
  <label><input type="checkbox" name="interest" value="Development"> Development</label>
  <textarea name="message" required></textarea>

  <!-- Spam trap: people never see it, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>
  • Each field arrives in the email, the inbox and your integrations under its name.
  • Write the special field names below in lower case, exactly as shown.
  • When a name is repeated, as in a group of checkboxes, the values are joined with a comma and a space: Design, Development.
  • A submission must have at least one field of your own.

Special fields

FieldWhat it does
access_key Required. Says which form the submission belongs to. It is not part of the submission.
subject The subject line of the notification email, unless you saved a subject for the form in the dashboard. Without either, the subject is "New submission: " and the form's name.
email When it holds one plain email address, it becomes the email's Reply-To, so replying to the notification writes to the sender. The autoresponder, if you use it, is sent to this address.
redirect The page the browser goes to after a successful plain form post. See below. It is not part of the submission.
botcheck The spam trap. Keep it hidden and empty. A submission that fills it in is answered as a success and thrown away. See Spam protection.
cf-turnstile-response, h-captcha-response, g-recaptcha-response The captcha's token, added by the captcha widget. They are never part of the submission.

Where the browser goes afterwards

A plain form post that succeeds is answered with a redirect (HTTP 303). FormRelay picks the first of these that applies:

  1. The redirect field, when it is a full http or https address on the form's own site. That means one of the form's allowed sites, or, when the form has no allowed sites, the site the form was posted from. An address anywhere else is ignored, so your form can't be used to send people to someone else's page.
  2. The address saved for the form under Settings, "After sending, take people to".
  3. FormRelay's own thank-you page.

A plain form post that is refused gets a short plain-text message with the matching HTTP status. To show errors inside your own page, send the form with JavaScript.

Accepted content types

  • application/x-www-form-urlencoded: what a plain HTML form sends.
  • multipart/form-data: what fetch sends with a FormData body, and a form with enctype="multipart/form-data".
  • application/json: one JSON object. See JavaScript and fetch.

File uploads

A form can take files on the paid plans, once "Accept files" is turned on under the form's Settings. Give the form enctype="multipart/form-data" and add a file input with any name:

<form action="https://submit.formrelay.domodomu.com/submit" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="email" name="email" required>
  <input type="file" name="attachment">
  <button type="submit">Send</button>
</form>
  • Up to 5 files and 4 MB per submission, files and fields together. Add multiple to the input to take several.
  • Each file is attached to the notification email, and listed with the message in the inbox, where the signed-in team can download it.
  • The field's value is the file's name, so exports and integrations show that a file came.
  • Programs, scripts, web pages and documents with macros (such as .exe, .js, .html, .docm) are refused.
  • A file is attached and offered for download only once its malware check has passed. If the check hasn't finished within a few minutes the email goes without the file and says so; the file can be downloaded from the inbox once it has.
  • A file is kept only as long as the submission's contents. Once they are cleared or the message is deleted it can't be downloaded, and it is erased within the hour.
  • A file input left empty is ignored. A file sent to a form that doesn't accept files is refused with a 400.

Limits

LimitValue
Fields in one submission50, not counting the special fields that are removed
Length of a field name100 characters
Length of a value10,000 characters
Size of all fields together (the request body)64 KB
Submissions a monthSet by your plan. See Billing in the dashboard.

A submission over a limit is refused, never cut short. The exact answers are listed under JavaScript and fetch.

Ready-made forms

These are the templates from the Install tab: plain HTML with labels and the spam trap, to paste and style your own way. The field names are what the email and the inbox show.

Contact

<form action="https://submit.formrelay.domodomu.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New message from the website">
  <label>Name <input type="text" name="name" autocomplete="name" required></label>
  <label>Email <input type="email" name="email" autocomplete="email" required></label>
  <label>Phone <input type="tel" name="phone" autocomplete="tel"></label>
  <label>Message <textarea name="message" rows="5" required></textarea></label>
  <!-- Spam trap: people never see it, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send message</button>
</form>

Newsletter

<form action="https://submit.formrelay.domodomu.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New newsletter sign-up">
  <label>Email <input type="email" name="email" autocomplete="email" required></label>
  <label><input type="checkbox" name="consent" value="yes" required> Email me news and offers</label>
  <!-- Spam trap: people never see it, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Subscribe</button>
</form>

Booking

<form action="https://submit.formrelay.domodomu.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New booking request">
  <label>Name <input type="text" name="name" autocomplete="name" required></label>
  <label>Email <input type="email" name="email" autocomplete="email" required></label>
  <label>Date <input type="date" name="date" required></label>
  <label>Time <input type="time" name="time" required></label>
  <label>People
    <select name="people">
      <option>1</option>
      <option selected>2</option>
      <option>3</option>
      <option>4</option>
      <option>5 or more</option>
    </select>
  </label>
  <label>Anything we should know? <textarea name="notes" rows="3"></textarea></label>
  <!-- Spam trap: people never see it, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Request booking</button>
</form>

Quote request

<form action="https://submit.formrelay.domodomu.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New quote request">
  <label>Name <input type="text" name="name" autocomplete="name" required></label>
  <label>Company <input type="text" name="company" autocomplete="organization"></label>
  <label>Email <input type="email" name="email" autocomplete="email" required></label>
  <label>What do you need?
    <select name="service" required>
      <option value="">Choose one</option>
      <option>New project</option>
      <option>Changes to an existing one</option>
      <option>Ongoing support</option>
    </select>
  </label>
  <label>Budget
    <select name="budget">
      <option>Not sure yet</option>
      <option>Under $1,000</option>
      <option>$1,000 to $5,000</option>
      <option>Over $5,000</option>
    </select>
  </label>
  <label>Details <textarea name="details" rows="5" required></textarea></label>
  <!-- Spam trap: people never see it, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Ask for a quote</button>
</form>

Feedback

<form action="https://submit.formrelay.domodomu.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New feedback">
  <fieldset>
    <legend>How did we do?</legend>
    <label><input type="radio" name="rating" value="Great" required> Great</label>
    <label><input type="radio" name="rating" value="Okay"> Okay</label>
    <label><input type="radio" name="rating" value="Poor"> Poor</label>
  </fieldset>
  <label>What could be better? <textarea name="comments" rows="4"></textarea></label>
  <label>Email, if you'd like a reply <input type="email" name="email" autocomplete="email"></label>
  <!-- Spam trap: people never see it, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send feedback</button>
</form>

Something missing or wrong? Email support@domodomu.com. New to FormRelay? See what it does or start free.