Aptuitiv Studio Documentation

Form Stubs

A form stub is a short form that is intended to feed into a larger form. A form stub will not be validated for any errors and any information submitted will not be saved in the database.

An example would be that you have a quote request form that is long. You could have a short form located on other pages of the site that only have the first name, last name, phone and email fields. That form would be submitted to the URL of the page where the full form lives. The data submitted should be used to pre-populate the larger form.

In order to create a form stub you need to include the following hidden form fields within the <form> tags:

<input type="hidden" name="apFormStub" value="1" />

If you are using a form template you could use the {#form.stub} tag to output that hidden form field.

Form Stub Template

The form template for the form stub would be created under the larger form. Do not create a separate form just for the form stub.

You will need to specify the form action. The form action should be the URL of the page that the larger form lives on.

Example Form

Because this stub form has to post to the URL of the page that the full form is located at (in this case "/contact") the <form> tag needs to be built out.

The {#form.key} and {#form.stub} are required.

Also because we're only using a few of the forms fields instead of looping through all fields we're only specifying certain ones.

<form action="/contact" method="post">
{#form.key}
{#form.stub}
<table border="0" style="width: 100%;">
   <tbody>
      <tr>
         <td>{#form.fields.firstName.label}</td>
         <td>{#form.fields.firstName.tag}</td>
      </tr>
      <tr>
         <td>{#form.fields.lastName.label}</td>
         <td>{#form.fields.lastName.tag}</td>
      </tr>
   </tbody>
</table>
</form>