Information Technology Services Header

FormServlet Basics

Online forms consist of a series of HTML tags that pass along information to FormServlet.  There are 6 tags required in a form that will send an email message:

<FORM METHOD="post" ACTION="http://www.umsl.edu/servlet/FormServlet">

    Required element for UMSL forms.  Tells form to use FormServlet to process form information.

<INPUT TYPE="hidden" name="URLreturn" value="http://www.umsl.edu/computing/FormServlet/examples/thanks.html">

    Required element for UMSL forms.  This tag specifies the HTML file that will be returned when the form is successfully submitted.  This can be any file - for example, you can have your form return to your homepage.  By copying the tag exactly as it is above, you can use our generic "Thank You Page" for your form. 

<INPUT TYPE="hidden" name="SMTPreturn" value="/path/to/your/template">

    Required element for UMSL forms.  This tag points to a text file that will format the output of the form.  With this function you can edit the email file that is sent with this form.  The examples will explain this tag more thoroughly.

<INPUT TYPE="hidden" NAME="E_Mail" VALUE="email@umsl.edu">

    Required element for UMSL forms sending email.  This tag specifies that the values are sent to the specified email address when the form is submitted.  CHANGE THIS TAG TO YOUR OWN EMAIL ADDRESS.

<INPUT TYPE="hidden" NAME="from_address" value="email@umsl.edu">

    Required element for UMSL forms.  This tag specifies the address the email message will be from.  This example uses this tag so that the from_address is hard coded into the HTML so that it never changes.  When the output is sent in to the email message, it will appear that the email is coming from email@umsl.edu.

<INPUT TYPE="submit" VALUE="submit">

    This tag creates the SUBMIT button.  Clicking this button will send the form values to FormServlet, and return the HTML file specified in the URLreturn tag.  Whatever text is used as the VALUE will be what appears on the button.

It is possible to create forms that interact with our Oracle database.  There are 5 tags required:

<FORM method="post" action="http://www.umsl.edu/servlet/FormServlet">

    Required element for UMSL forms.  Tells form to use FormServlet to process form information.

<INPUT TYPE="hidden" name="USER" value="some_user">

    This tag tells FormServlet which user is accessing the database.  The value of the USER tag points to a file hidden on the server with the database information: which database, login, password.  This file also contains the path to the SQL files for this user.  You must contact someone in the Web Office to have this USER profile set up according to your database space.

<INPUT TYPE="hidden" name="SQLFile" value="some.sql">

    The USER tag specifies where your SQL statements are filed, but this tag specifies which SQL statement to use.  The SQL file is simply a text file with your SQL statement.

<INPUT TYPE="hidden" name="URLreturn" value="http://www.umsl.edu/computing/FormServlet/examples/thanks.html">

    Required element for UMSL forms.  This tag specifies the HTML file that will be returned when the form is successfully submitted.  This can be any file - for example, you can have your form return to your homepage.  By copying the tag exactly as it is above, you can use our generic "Thank You Page" for your form.

<INPUT TYPE="submit" value="insert">

    This tag creates the SUBMIT button.  Clicking this button will send the form values to FormServlet, and return the HTML file specified in the URLreturn tag.  Whatever text is used as the VALUE will be what appears on the button.