HTML forms

Each form has an endpoint: an HTML form whose action is this endpoint sends its submissions to BackMyForm, with no server code, no API key and no JavaScript.

The endpoint of a form

The endpoint of a form is https://submit.backmyform.com/f/{shortId}, where shortId is the short id of the form: copy it from the form in the app, or read it with the API. Set it as the action of your form, with the POST method:

contact.html

<form action="https://submit.backmyform.com/f/k3x9q2mf" method="POST">
	<label>
		Name
		<input type="text" name="name" required />
	</label>
	<label>
		Email
		<input type="email" name="email" required />
	</label>
	<label>
		Message
		<textarea name="message"></textarea>
	</label>
	<button type="submit">Send</button>
</form>

Naming the fields

Every field with a name is received, under that name: there is nothing to declare in BackMyForm. The fields of the form are detected in the submissions, with the types of their values.

  • Give a name to every input, select and textarea: a field without a name is not sent by the browser, and is lost.
  • Use short, readable names that don't change: email, phone, message. A renamed field is a new field in BackMyForm.
  • A field sent several times, like checkboxes with the same name, keeps all its values: <input type="checkbox" name="topics" value="pricing">.
  • The buttons are sent too when they have a name: leave the submit button without one.

Checkboxes and select

<fieldset>
	<legend>Topics</legend>
	<label><input type="checkbox" name="topics" value="Pricing" /> Pricing</label>
	<label><input type="checkbox" name="topics" value="Support" /> Support</label>
</fieldset>
<select name="country">
	<option value="">Choose...</option>
	<option>France</option>
	<option>Germany</option>
</select>

After the submission

A form sent by the browser is redirected after the submission:

  • to the redirect URL of the form, when it has one: your own thank-you page;
  • else to the BackMyForm thank-you page, in the language of the form.

When the submission fails, the visitor is redirected to the BackMyForm error page, which explains the problem when it comes from the visitor (a file too large, for example). Set the redirect URL and the language in the settings of the form, or with PUT /v1/forms/:id.

To stay on the page and show your own message, send the form with JavaScript: see JavaScript.

To record the time to respond, the forms started and not sent, and the values typed before leaving, add the forms.js script to the page: the form works without it, but these are not recorded.

Files

To receive files, enable them in the settings of the form, and send the form as multipart/form-data:

application.html

<form action="https://submit.backmyform.com/f/k3x9q2mf" method="POST" enctype="multipart/form-data">
	<input type="email" name="email" required />
	<input type="file" name="resume" accept=".pdf,.doc,.docx" />
	<button type="submit">Apply</button>
</form>

The settings of the form choose the types of files accepted, the size limit of a file and the number of files in a submission. The type of each file is checked from its name and its content. The free plan limits each file to 5 MB.

Limits

LimitValue
Submissions per minute from one visitor (IP address) to one form30
Submissions per minute from one visitor to all the forms100
Fields in a submission200
Length of a field name200 characters
Length of a value10,000 characters
Size of the values of a submission, files apart1 MB

A submission over a limit is refused, and redirected to the error page.

Spam

The submissions are checked for spam before they are delivered: the spam doesn't send emails or webhooks, and is kept apart in the app. The check is on by default, and can be turned off in the settings of the form.

The badge

On the free plan, the "Powered by BackMyForm" badge must be shown under each form. Add it with this image, exactly as is: it is empty on the paid plans, so you can add it to every form, and it shows only when it has to. A paid plan can also hide the BackMyForm branding of the thank-you page (showBranding: false).

Badge

<a href="https://backmyform.com" target="_blank" rel="noopener">
	<img src="https://submit.backmyform.com/f/k3x9q2mf/badge.svg" alt="Powered by BackMyForm" />
</a>