Forms
Forms provide a way to interact and gather information from the visitors
to your web site. Forms consist of two parts: HTML code which includes
the form fields and the script (cgi script) which processes the information
submitted.
CGI (Common Gateway Interface, usually written in Perl or VBScript or
javascript) is a method of sending information between a server and processing
script.
<form></form> element can be placed anywhere inside
the body of an HTML page and it contains hidden values which sends information
to the server but will be invisible to the user. eg: email address
Lets have a look at a simple form example:
<html>
<head>
<title>Form</title>
</Head>
<body>
<form method="post" action="http://www.xxxx.co.uk/cgi-bin/formmail.pl">
<INPUT name="recipient" type="hidden" value="your
email address">
<INPUT name="subject" type="hidden" value="your
form subject">
Name:
<input type="text" name="FirstName size="25"><p>
<p> Surname:
<input type="text" name="surname">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>Sex:<br>
Female
<input type="radio" name="radiobutton" value="female">
Male
<input type="radio" name="radiobutton" value="male">
</p>
<p>What newspapers do you read?
Times:
<input type="checkbox" name="Newspaper 1" value="Times">
Daily mail:
<input type="checkbox" name="Newspaper 2" value="Daily
mail">
Guardian:
<input type="checkbox" name="Newspaper 3" value="Guardian">
Observer:
<input type="checkbox" name="Newspaper 4" value="Observer">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="submit" name="Submit2" value="reset">
</p>
</form>
Click here to the see
the form. The layout of the form looks very untidy! In the next exercise
I will show you a better way to design forms using table.
More about forms:
[1]--- [2]
Copyright © 2001 koodesign
|