Note: The form builder only supports the Standard Viewer at this time: these forms will not function in the Verge viewer.
What is the Form Function?
The form function within Zmags is a valuable function aimed at providing you with an easy to use Do-It-Yourself contact form and survey builder. The form builder is normally used to send surveys from readers to an email address but it can also be used to post the contents to a URL for input into a CRM system.
This tutorial will detail the process for adding a form to a publication, how to customize with specific fields, and how to define what happens when a user submits the form.
To begin, log into the Zmags Publicator and click on "All Publications". To the right of your publication's name in the list, click the icon in the Enrichments column. The form option inside the Publicator is the third one listed in the menu on the left.
Clicking this option will change the mouse cursor to a tool for determining the location and size of the form to be added. You can drag the corner to increase or decrease the size of the form area.
A new tools window will now have opened where the types of fields to be added to the form can be selected.
Click and drag items from the window to the form area to add them. It is then possible to move that form field around the form area to find a suitable placement. Labels can also be added for each field and a "Submit" button.
Note that labels do not have text wrapping, they only display text on a single line.
Having completed form construction, click the form area to open the following window. This provides options for how the form is to be submitted, and a text entry field to specify the message displayed to users after they have successfully submitted the form.
Click "File" > "Save All" in the top-left corner. If you are using "Sent to e-mail", you are now finished, and may exit Zmags Enriched at this time.
POST to URL Instructions
When creating a form container the key thing to do is to make sure that you have set the following parameters correctly:
Form Action: [Post to URL]
URL: [the URL of the form receiving page on your server]
Submit text: [the confirmation message back to the user]
Another key thing to make sure is that you have set identifiers to all of the fields you have included in the form. Identifiers are variable names that are passed through to your receiving page from the form and this enables you to grab the submitted information from the form fields.
View example here
In the above example the following form identifiers have been setup in the form:
Form receiving page instructions
Below you will find a downloadable example form receiving page built in PHP which demonstrates how this works. The page very simply places all of the form submissions into a text file on a server you control. Unfortunately we do not have any other examples in any other languages but you should be able to see how the form is received and then re-program your page accordingly.
Download resource files here
The form receiving page will need to be hosted on your server and will need to be a server side processing page built in one of the many server languages such as PHP / JAVA / ASP etc. The form variables that are passed through are passed as through with a content type of application/x-www-form-urlencoded
In the above example the following identifiers are sent through to the page when the form is processed:
You must also make sure that the form receiving page does not have any response on the page such as HTML / XML.