"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."


HTML   Advanced HTML For Beginners > HTML > HTML Forms

 Register

HTML

  • Learn the 7 input types of HTML forms
  • Complete HTML forms tags list
  • Join our busy webmaster forums!

Forms start with the <form> tag, which tells the browser where to send the information, then they have a few input fields, then a usually a submit button and a reset button.

Let's get started.

As stated above, this tag starts the form. Here is an example use of the <form> tag:

<form action="http://www.geocities.com/cgi-bin/homestead/mail.pl?yourname" method="post">

This code will not show up in the web page, it's invisible. It is the "input types" that you put in your code that create the visible part of your HTML form, with the exception of input type hidden.

  • form * - tells the browser that the next section of the web page will be a form

  • method * - tells the browser how to send the information (possible values: post is the most often used, and there are a few others)

  • action * - tells the browser where to send the information (the one shown is a mailto: form, and sends it to an e-mail address. Otherwise, they are usually sent to a location)

  • enctype - this is only used when the action attribute is mailto. This tells your e-mail client what type of e-mail it will be sending

* = mandatory

Forms are a little tricky, you must have a script that will take the information and do something with it. In the above example, Geocities is using a CGI script named mail.pl.

You've learned how to start a form, now lets learn the rest. There are seven kinds of input types: "text", "checkbox", "radio", "hidden", "password", "reset", and "submit". These all have different attributes to them; read about them by following the remaining HTML form tutorials. There is also another type of input, which creates a large window into which one can type text, but it is not a true "input type", this is called the textarea.

Back to the HTML Forms Tutorials menu.

Web Hosting
Shared       
Reseller     
VPS             
Dedicated 
Price:   $(US)
Space:     (MB)
Transfer:(GB)
Platform:


HTML Forum

HTML Tools