<form>

Putting the script in your html

 

The tags for inserting a form are very easy. Look at the form you filled out on the introduction page for this unit as an example.

Like most features on a web page, the form opens with <form> and closes with </form> at the end.

As when you add features to the opening <body> or <td> tag, you add features to the opening <form> tag to tell the computer whether to use a "post" or "get" method and where the program is that will process information. (This is "where the action is"—if you want a corny explanation of why the code reads "action=" and the value is a URL address). Altogether the opening tag turns out to be something like:

<form method="post" action="/cgi-bin/ohlone.online.pl">

In between the opening and closing form tags you have a variety of <input> tags. For every input you define:

  • "type" of input, which may be
    • text
    • checkbox
    • radio
    • password
    • reset
    • submit
  • "name" of field, which should match the name on the script

For each of the types of input there are particular additions you make to have the input work.

Consider putting your form into a table so that it looks orderly. If you do this, have your <form> before your <table> tag, and have the </form> after your </table> tag. This means you nest the table inside the form.

<< Return to "First the Server"

<<Return to Unit 11

 

 

Copyright by dwang, 1999. All rights reserved.

Valid HTML 4.0!