Skip to content

Add Forms

iJungleboy edited this page Jan 24, 2017 · 2 revisions

Overview to Adding More Forms

Since the setup is generic, you can do anything you want. The basic setup allows you to easily add more custom forms.

Note that you only need to do this, if you want multiple different forms in this app. If you only want to customize the one form and/or re-use the same form again, this is not for you.

Note that you should also read the Overview as it helps you understand why certain steps are recommended.

Create More Forms With The Default Pattern

The default pattern assumes you'll work with the standard Save-WebApi or with your own WebApi, which expects the same configuration as the standard setup does.

  1. Create another content-type with the fields you want to store.
    1. In here, create all the fields you want to store
    2. We recommand that you also add fields for
      1. Timestamp (date)
      2. SenderIP (string)
      3. ModuleId (number)
    3. You can also create a Title field which would be auto-filled with "Form 2017-xx-xx" (the current date/time)
    4. You can also create a RawData field (type: Custom) into which the save-script would just put the raw JSON of all submissions - great for debugging
  2. Optionally - but often not needed: create custom mail templates
  3. Optionally - but often not needed: create custom save-WebAPI
  4. Now, create a SubmitType content-item which configures that the WebApi (the default or yours) should create the expected Content-Type (the new one you just made) and should use the e-mail templates you specified. Often you'll just copy an existing SubmitType-item and change just the Content-Type.
  5. Create a new form file - best to copy the existing _Contact Form.cshtml and then modify it as needed.

That's all you need to do. If you want to customize even more, you can always change anything you want - even the JS or the WebApi.