Perch forms vs Perch Forms app

Due to the similar naming it is not uncommon to confuse the Perch form template tags with the Perch Forms app. This could be because most developers start using Perch form template tags with the Forms app. So what’s the difference?

Perch form tags

Perch’s templating engine has specific tags for rendering HTML forms. This is built into core Perch and does not require you to install any add-ons.

The form tags can be used to render HTML form tags. The form submissions do not have to be processed by a Perch app (more on this below). The point is you can use Perch’s templating engine to render HTML forms regardless of how the form submissions are processed.

<perch:form id="newsletter" method="post" action="/">
    <div>
        <perch:label for="visitor_email">Email</perch:label>
        <perch:input id="visitor_email" type="email" label="Email" required inputmode="email">
    </div>

    <perch:input id="submit" type="submit" value="Sign Up">
</perch:form>

You can learn more on how to render the different HTML input types in the documentation.

Handling form submissions

When you render a HTML form with Perch form tags, you have the option to assign a Perch app (or multiple apps) to process the submissions by using the app attribute:

<perch:form id="contact" method="post" app="my_app">
</perch:form>

Perch Forms app

Perch Forms is a first-party app that can process form submissions. It is ideal for simple use-cases such as contact forms. It can store form responses, send email notifications and redirect the user after a successful form submission. After installing the app, you can add the app key to your forms:

<perch:form id="contact" method="post" app="perch_forms">
</perch:form>
link

Related articles