In most of the Web design courses, we will be using the script named formmail.asp to process our forms. Remember that the script will control what happens to the data submitted through a form once it reaches the server. When a script is written, the programmer decides what will happen to the data and if they want to provide a way for the Web designer to customize the script through the HTML code.
In general, this script will do the following when the form is submitted:
The script we are using, formmail.asp, allows us to customize how a form is processed using the input tags described in the table below. Most of these input tags are hidden which means that the visitor filling out the form doesn't see them, but they are included in the data that is sent to the script when the form is submitted. The script will know how to use this data when processing the form.
This script is located at https://www.mccinfo.net/webresources/cgi-bin/formmail.asp. The first step is to set the form action and method in the <form> tag. This should be set as follows:
<form method="post" action="https://www.mccinfo.net/webresources/cgi-bin/formmail.asp">
To control how the form is processed, you can include a few (or many) of the input tags listed below. Due to security issues, the recipient is being defined by the script. We cannot customize the recipient email. All emails generated by this script are being sent to the email address infowebforms@mccneb.edu that all instructors are able to acces.
One more thing I want to emphasize is that all input element must include the name attribute describing the data. As illustrated in the text book we are using, it is recommended to include both the id and name attributes defining the form controls. But this script specifically uses the name attributes when identifiying the data collected.
The hidden input tags listed below can be used and will need to be placed any where on the form between the opening and closing form tags. As good practice, please place all of these hidden input tags at the beginning of the form right after the open form tag.
Here is a sample form. To view the sample code, click the link to open the form and then use the browser command to view the page source.
![]() |
Sample form using the formmail.asp script.
|
Input name | Description |
---|---|
subject | Subject of the email message. Use input type="text" if you want the user
to be able to set the topic. Use type="hidden" if you want to set the
subject line
Example: To
allow the user to choose a subject: |
realname | The name of the user filling out the form as entered by
the user.
Example: |
This form field will allow the user to specify their return
e-mail address. If you name the text field "email", the
ASP script will require that the format of the email address entered
be in a valid format. This also makes the email input field a required
field. If you don't want this field to be required, use a slightly
different name for the the input field. Something like "emailaddress" could
be used.
Example: |
|
comments | Textarea or field with the actual message of the sender |
required | Defines what input fields must be filled out by the user. Use a
comma-delimited list for the value, for example value="email,realname,phone"
Example: |
hide_blanks | Hides blank fields in the emailed results. If you add this field to your form with a value of "1" fields not filled out by the user are not printed in the body of the email message. Example: |
bgcolor | Background color of the return page.
Example: |
background | Background image of the return page. Must be a complete URL
Example: |
text_color | Color of text on the return page. Example: |
link_color | Color of links on the return page. Example: |
vlink_color | Color of visited links on the return page. |
alink_color | Color of active links on the return page. |
title | Title of the return page.
Example: |
return_link_url | The URL of the page the user gets to from the return page. Must use a complete URL
Example: |
return_link_title | Title of the return link.
Example: |
font_face | Font face on return page. Use comma delimited list.
Example: |
font_size | Font size on return page. The value used with this tag is based on the HTML font size scale of 1-7. Example: |
no_table | Set value to "1" if you don't want tables on the return-page |
env_report | Use the value of HTTP_USER_AGENT and the browser that the
user is in will be reported along with the information they submit in the
form.
Example: |
Updated March 4, 2025