[image] IU SLIS logo

Demo page logo


HTML Demonstration Page: Forms


Forms are a useful extension to html markup because they allow you to add some interactivity to your pages. With forms, you can receive information from people who visit your page in more detail than simply using a <mailto>. This type of markup gives you another level of control over your web pages and allows visitors to provide you with much more specific and targeted feedback

A form is made up of a series of input controls which are displayed in a variety of ways on the screen. There are buttons to push, boxes in which text can be typed, pull-down menus, from which you can select an option, and checkoff boxes to select. Forms are completed when the visitor clicks on some type of select button to submit the information they have placed in the form

To take full advantage of forms, you should have a script, or program, that runs on the server that can process the information for you. We will not cover the creation of scripts because it involves learning some computer programming. This allows you to have the information placed into a database, to generate an automatic reply, or to have a particular file sent to the visitor

You can place as many forms as you want in a document


Creating forms: Basic markup

Creating forms: input mechanisms

There are a number of options that you can use to create the input mechanisms for form, each requiring its own markup elements. All will begin with the same opening attributes: <input type="..." name="...">. The input type specifies the type of form element and the name specifies a name for the element that will be attached to the information that is input into the element's field. This is necessary for identifying and sorting the information once it has been submitted

When you are setting up a page with form elements, you can place text above and below the specific element. This is a useful way to provide instructions for the person filling out your form

NOTE: if you want to have all the information that is placed in the various form input mechanisms sent as a single data file, you should use only one set of paired <form> tag at the top and bottom of the page

Also, as will be explained below, you use one set of submit and reset buttons

Here is an example of a page that uses these forms elements.

And here is an example of a page that uses these forms elements along wiith a PHP script for processing the input.


Demo Page
Navigation:
DemoPage contents About HTML UNIX help html tags Lists Links Images
Imagemapping Tables Forms Frames Javascript CSS (style sheets) XML


Page by Howard Rosenbaum
Find me at hrosenba@indiana.edu http://www.slis.indiana.edu/hrosenba/www/Demo/Demo9.html