Feature Spotlight: Forms

I'm a little excited about how good this is.

If you take any form and set the action attribute to action="/siteapi/submit_form" then we'll keep track of it.

We have a bootstrap 3 form, from a starter template we've been using for earlier posts. It looks about like this:

With this Markup:

We'll edit the <form> tag just a bit. Using POST is preferred. We'll also add the {% csrf_token %} tag. This assists in spam and malicious content prevention. While it's not required, you should add it anyway.

Now whenever someone saves a form, it will be available in the control panel, and any associated webhooks will fire. Pretty cool right?

The most common case is form-to-email. All you have to do to ensure that form-to-email works is add another input: <input type="hidden" name="to" value="you@example.com"> with your email in the value attribute.

It must be an email associated with your site. If you need help contact support.

If everything is set up correctly, submitting this form:

Will send you this email!

There's lots more you can do with forms, like redirects and success messages, check the extended docs.

Glass is a complete web management platform. It is built specifically for the needs of web professionals and their clients. Try it now for free.