DeveloperTutorials for Web Developers & DesignersForms

Example: In-Store Registration Form

This example is useful for in-store forms where a PC terminal or iPad is shared for electronic data capture. Users are not kept logged in, and they are redirected back to the form for subsequent submissions.

Possible applications are:

  • In-store electronic feedback form at point of sale.
  • Electronic competition form on an iPad at a trade show.
  • Electronic form to join a birthday club.
  • Any other type of registration form.

The Form

Create a new page for the form. You will likely want to create this at a location like /forms/competition/ or /forms/feedback/.  Set the pages to be "Hidden in Navigation" and "Hidden in Sitemap", so that it isn't found easily by website visitors. 

Editing the <forms:form> tag, set the following attributes:

Set a unique ID to identify this form from others.

To register the user into the database.

To record a copy of the submission under Website > Pages > Forms.

To redirect the user to the success page.


<forms:form id="feedback_form" contactmode="store" recordsubmissions="true" onsubmitredirect="/forms/feedback/success/"> <forms:row label="Full Name" description="Required"> <forms:editbox validations="mandatory" id="contact_first_name" width="90" /> <forms:editbox validations="mandatory" id="contact_last_name" width="110" /> </forms:row> <forms:row label="E-mail Address" description="Required"> <forms:editbox transformations="tolower" validations="mandatory,email" id="contact_email" width="180" /> </forms:row> <forms:row label="Date of Birth" description="Format: DD / MM / YYYY"> <forms:editbox id="contact_dob_d" width="20" /> / <forms:editbox id="contact_dob_m" width="20" /> / <forms:editbox id="contact_dob_y" width="40" /> </forms:row> <forms:row label="Phone Number"> <forms:editbox id="contact_phone" /> </forms:row> <forms:row label="Your Feedback Please" description="Help us improve by providing honest feedback"> <forms:textarea id="your_feedback" width="99%" height="150" /> </forms:row> <forms:row align="center" type="one_column"> <forms:submitbutton value="Submit Feedback" /> </forms:row> </forms:form>

The Success Page

The success page must have the following:

In the "Page Source", redirect back to the form.  You can update the timeout and redirect URL.

<script type="text/javascript"> setTimeout(function() { window.location = '/forms/feedback/'; }, 4500); </script>

In the PHP "Server Code", auto-logout the user.

<?php \Components\Customers\Contacts::currentLogout(); ?>

Other Optimisations

  1. Ensure their consent is obtained for marketing.
  2. Ensure there is a link to your Privacy Policy.
  3. Consider capturing birthdays for automated marketing.