Marketpath CMS forms provide a simple and straightforward mechanism to quickly capture visitor data for just about any type of purpose. Inserting a form into an editable content area is just as easy. Both of these operations can be performed by a skilled content editor.
A Marketpath CMS Form has the following default fields:
Send Form Submission Emails To will send an email to all recipients in this field with form details upon each submission.
Redirect URL is the page where a visitor will be sent upon successful form submission.
Template Override is where a developer can set a custom template to be used for rendering this form. We do not recommend doing this at this time. See all considerations below.
Formatting, styling, and adding any type of custom functionality to a form is when a good developer is required.
Like all objects in Marketpath CMS, we provide a default rendering for forms. Below you'll find the code for a simple contact us form. All unique ID's have been replaced to shrink the code. This is the default rendered HTML of a form in Marketpath CMS.
<script src="https://mp-resources.azureedge.net/tools/MPForms.1.2.0.min.js" defer></script> <script src="https://www.google.com/recaptcha/api.js?render=explicit&onload=MPCaptchaRenderAll" defer></script> <div class="mpform-default"> <form enctype="multipart/form-data" id="[instance-id]"> <div> <span class="label">First Name</span> <input type="text" name="first_name" id="[instance-id]_first_name"/> </div> <div> <span class="label">Last Name</span> <input type="text" name="last_name" id=[instance-id]_last_name"/> </div> <div> <span class="label">Email Address</span> <input type="text" name="email_address" id="[instance-id]_email_address"/> <span class="mp-formfield-validation-message email_address_errormessage" style="display:none"></span> </div> <div> <span class="label">Comments or Questions?<span class="required" title="required"> </span></span> <textarea name="comments" id="[instance-id]_comments"></textarea> <span class="mp-formfield-validation-message comments_errormessage" style="display:none"></span> </div> <div class="subscribe_newsletter_conditional"> <span class="label">Subscribe to the MP Financial Insights newsletter</span> <input type="checkbox" name="subscribe_newsletter" id="[instance-id]_subscribe_newsletter"/> </div> <div> <div class="g-recaptcha"></div> <span class="mp-formfield-validation-message [field-guid]_errormessage" style="display:none"></span> </div> <div> <button type="submit" id="[instance-id]_submit">Submit</button> </div> <span class="mp-form-message [instance-id]" style="display:none"></span> </form> <script> window.addEventListener('DOMContentLoaded', function() { MPForms('[instance-id]', [ { "id":"first_name", "type":"text", "name":"first_name" }, { "id":"last_name", "type":"text", "name":"last_name" }, { "id":"email_address", "type":"text", "name":"email_address", "validators": [ { "Type":"email"}] }, { "id":"comments", "type":"textarea", "name":"comments", "required":true, "requiredMessage":"This field is required" }, { "id":"subscribe_newsletter", "type":"checkbox", "name":"subscribe_newsletter", "condition": {"Type":"exists","FieldID":"email_address","Invert":false} }, { "id":"[field-guid]", "type":"captcha", "sitekey":"6Le0TREUAAAAAF1DV7SlmTdHxDzJzn1k_8vOpEFg", "theme":"light", "size":"normal", "required":true }, { "id":"[field-guid], "type":"submit"} ], { action:"/mputils/[site-id]/submit-form/[form-id]", successHandler:'redirect: //demo.live01.dev.marketpath.site/thank-you' } ).init()}) </script> </div>
It is very likely this is not the HTML you want to output. At this time, we do not have any standard form templates you can use to build your own custom forms. However, understanding the logic above, you can attempt to implement your own forms as long as you follow the outline. You will likely have to provide your own validation and error handling. But it can be done.
Marketpath CMS is soon releasing a package manager feature that will allow you to download reusable code, including form templates. Keep an eye out for that.
As a developer, data security and privacy should be of utmost concern. It's important to understand how data is transmitted and stored in Marketpath CMS. We recommend you avoid sending and storing credit card numbers, social security numbers, and other highly secure and private information.
Marketpath CMS transmits data based on the protocol of the current page. If your site is not requiring a secure connection and using regular http then your data will be transmitted in plain text across the network. You must avoid this and ensure pages with forms are properly secured.
Even if your forms are properly secured using https, the data may be transmitted via plain text in an email notification. On each form there is a field with the label Send Form Submission Emails To. If there is a value in this field, all form field values will be emailed to those recipients. Since email is typically sent via plain text, the submitted data will also be in plain text.
Marketpath CMS stores its form data in plain text JSON format. The data is not encrypted when stored in the database.
Forms can be simple and straightforward, but they can also be complicated, difficult to manage, and even tougher to develop custom solutions for.
There is a significant amount of functionality baked into forms without requiring a single line of code. That includes form validation, grouping fields together, showing/hiding fields (and groups of fields) based on values entered into other fields, spam prevention (via Google reCAPTCHA), and more.
For what they are, forms in Marketpath CMS work well. However, there are a couple limitations of forms in their default rendered state that are good to be aware of as a developer:
Given all of these limitations, our recommendation is to use Marketpath forms for common simple functionality.
One new feature you'll cover later in this course is marketing automation. With Marketpath's integration with Zapier, you can capture form submissions and perform a nearly unlimited number of actions on that data, such as:
We highly recommend learning about this feature and taking advantage of it.
Please fill out the form below with your feedback or any questions you may have after working through the "Forms" lesson.