Multimedia WWW Series:
Forms

What is a form?

A form is a web page or part of a web page that allows the user to enter data using the familiar elements of a graphical user interface. Visible parts of a form include pop-up menu's, radio buttons, selection lists, etc. . The information entered into the form is then sent somewhere for processing, emailed somewhere, or reflected right back to the user.

What you need to start:

By the end of this session you will know:


Samples


Form1 - Who and how are you?
Enter your name:
Click here if your having a good day:


Form 2 - Your favorite season
spring
summer
fall
winter


When you click send this form will send this information to the email address below:


Form 3 - Submit your favorite fruit with a password
What is your favorite fruit?

Why is this your favorite fruit?

What is your fruit password?

How To

The HTML you need to create a form:

  1. The <FORM></FORM> tag.
  2. The <INPUT>, <SELECT>, or<TEXTAREA> tags.

The <FORM> tag

The form tag has a beginning, <FORM>, and an end </FORM>. A simple <FORM> tag looks like this:

<FORM action=http://www.ucc.uconn.edu/~virtclas/formrefl.html>

Some other stuff

</FORM>


The URL http://www.ucc.uconn.edu/~virtclas/formrefl.html points to a file that tells you what your form contained. NOTE:Formrefl.html only works with the GET method. More on this later.

The <FORM> tag has 3 attributes:
Attribute Description Default
ACTION Where the forms contents will be submitted The page the form resides on.
METHOD The method used to submit the form - either GET or POST GET
ENCTYPESpecifies the type of encoding - There is only 1 possible value, and it only applies to the POST method. application/x-www-form-urlencoded

The <INPUT>, <SELECT>, or<TEXTAREA> tags.

The easiest way to learn these tags is by example. Below you will find a sample forms elements side by side with the HTML that created it. Of course, the HTML snippets below must reside inside the <FORM></FORM> tag set.

Some definitions that make the examples easier to understand:

type
The type of "widget" you want to use - test,password,checkbox,radio,submit,reset.
name
The symbolic variable name associated with a widget.
value
The defualt text value of a widget, if applicable.
checked
Causes the checkbox or radio button to be selected by default.
size
The physical size of a text box.
maxlength
The maximum number of characters a text field will accept.

Exercise

Create your own form combining parts from above. Send the form to http://www.ucc.uconn.edu/~virtclas/formrefl.html and see what you get. Alternatively you could send your results somewhere via email by using SENDFORM.

The Multimedia Lab provides a variety of software for your use. Animation, rendering, and media capture are all available. Stop by the lab for details!

virtclass@uconnvm.uconn.edu