MailPost
Data persistence across forms

MailPost can also span multiple forms, gathering information. This is accomplished by using the *nosend* variable along with using variable substitution HTML success pages.

Place the *nosend* hidden variable in all of the forms except the last form which actually sends the data or saves it to a file.

For this example, you will first be asked for your name and location. The next form will ask you for your email address, and then it will show the result.

The following actions were taken to produce the result:

  1. Create the form's template file that will be used with both of these forms. This example's template file is named template.txt
    To: mailpost@mcenter.com
    From: mailpost@mcenter.com
    Subject: Data persistence example
    
      [name] filled out this form on [*date-time*] .
    
    [name]'s location: [location]
    
    [name]'s email address: [email]
  2. Create the first form. This form asks for the user's name and location. It's success page points to the second form's HTML file. The first form has the hidden variable *nosend* .
  3. Create the second form named form2.html. This is the success page for the first form, and will be the second form displayed to the user. This form does not use the *nosend* variable. Place the previous form's variables (required-name & required-location) into hidden form variables
    <INPUT TYPE="HIDDEN" NAME="required-name" VALUE="[required-name]">
    <INPUT TYPE="HIDDEN" NAME="required-location" VALUE="[required-location]">

These two forms also specify an *on-error* variable that points to the error.html file. Just as with the "success" variable, you can use variable substitution with the *on-error* page as well. There is a special variable that is generated by MailPost when an error ocuurs. It is named *error-msg* . You can include it in the HTML document to display what error occurred.

Note that all of these files can be named whatever you wish.

  

Name:

Location:

  
                 
  
 

MailPost Homepage