HTML Forms
K. Yue @copyright 1997-2001, revised August 21, 2001

I. The ISINDEX element (Deprecated)

This is a searchable index. Enter search keyword: _____________

Example:

<HTML>
<HEAD>
<TITLE> Dr. Yue's Simple Searchable Database</TITLE>
<ISINDEX PROMPT="Keyword to search the course database:">
<BASE HREF="http://dcm.uhcl.edu/yue/dbsearch.cgi">
</HEAD>

II. The FORM element

III. The Input Element

Example:

<INPUT TYPE="text" NAME="Comments">
<INPUT TYPE="text" NAME="Actor" SIZE=30
       MAXLENGTH=100 VALUE="Brook Shield">

Example:

<FORM ENCTYPE="multi-part/form-data"
METHOD="POST" ACTION="cgi-bin/process_hw.cgi">
Your name: <INPUT TYPE=text NAME="Name" SIZE=40>
<P>
Your Homework File Names: <INPUT TYPE="file" NAME="hw">
<P>
Submit <INPUT TYPE="SUBMIT">
</FORM>

Example:

<FORM ACTION="fruit.cgi" METHOD="get">
What are your favorite fruits?
<P>
<INPUT TYPE="checkbox" NAME="food" VALUE="mango"> Mango
<BR>
<INPUT TYPE="checkbox" NAME="food" VALUE="orange"> Orange
<BR>
<INPUT TYPE="checkbox" NAME="food"
CHECKED VALUE="apple"> Apple
<BR>
<INPUT TYPE="checkbox" NAME="food" VALUE="banana"> Banana
<BR>
<INPUT TYPE="submit">
</FORM>

If Orange and Apple are selected, then the query string will be food=orange,apple.

<INPUT TYPE="image" SRC="picture.gif" NAME="pic">

<INPUT TYPE="hidden" NAME="from" VALUE="form1">

IV. The TEXTAREA and SELECT elements

Exercise 1:

Create a good looking form that gathers the following information from the users:
last name, first name, SS# (which should not be displayed), sex, major (CS, CIS, CSDE, CENG, SWEN, MATH, STAT), proficient languages (C, C++, Ada, Perl, Lisp, Prolog, Fortran, Basic, Scheme, Pascal and Java).