Verifying Form Information
Example
- Requiring a name, phone number, and email address in an information
request form.
MGI Tags
Steps
- Create an information request form and thank you page to process the
form.
- Open the thank you page in a text editor.
- Insert the mgiCheckField tags.
- Save the thank you page.
- FTP the form and thank you page to the web server running MGI.
- Complete and submit the form.
Step 1: Create an information request form and thank you page.
- Create an information request form and thank you page to process the
information request form and send an email. See the Beginner "Processing Forms to Email" Tutorial
for the steps to create an information request form and thank you page.
When you create the information request form, you may wish to mark fields
that are required (with an asterisk or bolded text). For example,
Step 2: Open the thank you page in a text editor.
- Open the thank you page in a text editing program that allows you to
modify the HTML of the page.
Step 3: Insert the mgiCheckField tags.
- Insert your cursor above the mgiSendMail tag and enter an mgiCheckField
tag and name parameter for each field that you want to verify. In the name
parameter, enter the name of the form field to verify. For fields that
should contain properly formatted email addresses, also insert the isEmail
parameter. In the isEmail parameter, enter "Yes" to verify that
the syntax of the information in that field is text followed by an "@"
sign followed by text followed by a period followed by text (e.g., name@domain.com).
The isEmail parameter will not verify the legitimacy of the email address
itself.
<mgiCheckField name="name">
<mgiCheckField name="phone">
<mgiCheckField name="email" isEmail="Yes">
<mgiSendMail to="info@domain.com" from="webmaster@domain.com"
subject="Info Request" mailserver="mail.domain.com">
Information Request
*******************
Name: <mgiFieldContent name="name">
Company: <mgiFieldContent name="company">
Address: <mgiFieldContent name="address">
City: <mgiFieldContent name="city">
State: <mgiFieldContent name="state">
Zip: <mgiFieldContent name="zip">
Country: <mgiFieldContent name="country">
Phone: <mgiFieldContent name="phone">
Email: <mgiFieldContent name="email">
Comments:
<mgiFieldContent name="comments">
</mgiSendMail>
Step 4: Save the thank you page.
- Save the changes you have made to the thank you page.
Step 5: FTP the form and thank you page to the web server running MGI.
- Upload the information request form and thank you page from your local
computer to the web server using an FTP program.
Step 6: Complete and submit the form.
- Access the information request form page in a browser, complete the
form and submit the form. If you enter at least a name, phone number and
properly formatted email address, an email containing the form information
is sent and the thank you page is displayed. If the name, phone number
or email address is not entered, or if the email address is not entered
in the proper syntax, then an error page listing the name of the required
form field is displayed and the email (from mgiSendMail) is not sent.
|