CreateaFreeWebsite

Basic HTML Forms
Barebones

Yes, there are countless sites on the internet that offer free forms and scripts.

If you've ever downloaded a set, made changes and uploaded to your web hosting service only to find it doesn't work, you've got lots of company.

The solution is setting up a LOCALHOST server on you PC or laptop for editing and testing before you upload.

The forms on this website are Barebones. We use just enough code to make them functional.

Our actual purpose is to teach beginners to use a Localhost server on their PC or laptop for testing forms and scripts before uploading to their web hosting for online use.

This will save a lot of time and frustration when uploading to your web hosting service.

Take some time here and learn to set up a localhost server on your computer.

What Are Forms?

Forms are interactive devices used to gather information from your users.

They can incorporate the use of text boxes to gather typed information or provide choices of data using, check boxes selection boxes and even radio buttons

To be able to use forms, the server on which your site is located must provide CGI capabilities. You can forget that if you've settled on using FREE web hosting.

CGI is a system of files that process data received from forms.

The Form Tags

Form <form></form>

Attributes

Method
There are two methods used by browsers to send information to a server. They are Post and Get.

These are specified in code as:
<form method="POST">
<form method="GET">

Action Tells the browser what CGI program to use and where it is located.

A form tag with both attributes would be coded as:
<form method="POST" action="parse-form.php">

In this example the code tells the browser to use the post method, and to use the PHP script, parse-form.php, located on the server.

Input <input></input>

Attributes
Two required attributes are Type and Name.
Type specifies the device used.
Options:

Name A name assigned to the information or data collected by the input device. The server receives information in name/value pairs.

Value is the information chosen or entered by the user.

Name identifies that information. (Don't go on until this concept sinks in.)

Optional: required (supposedly cuts down on the empty forms you receive)
Example:


<input type="text" required="required">
or
<input type="text" required>

 

See: Setting Up a Localhost server

 

Top