Skip to content

How to add a form via GetForm.io #223

Answered by razonyang
imranakram asked this question in Q&A
Discussion options

You must be logged in to vote

Layout

Create a layout called layouts/_default/contact.html with the following content:

{{ define "main" }}
<form action="{{ .Site.Params.contact.endpoint }}" method="POST" enctype="multipart/form-data">
    <input type="text" name="name">
    <input type="email" name="email">
    <input type="file" name="file">
    <button type="submit">Send</button>
</form>
{{ end }}

Page

Create a page called content/contact.md with the following content.

+++
title = "Contact Us"
layout = "contact"
+++

The layout must be same as the name we created above.

Parameters

[contact]
  endpoint = "REPLACE_WITH_YOUR_GETFORM_ENDPOINT"

Now, you can access your contact page via /contact.

The page may look ugly, s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@imranakram
Comment options

Answer selected by imranakram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #222 on December 01, 2021 23:36.