Learn HTML Basics - HTML Form Tutorial  
Learn HTML Basics – Introduction and page one of Learn HTML Basics will dive right into the basics of HTML, and will teach you the meaning behind html and will try and give you a basic understanding of what it is, before we show you more of the basics of html.
   
Learn HTML - Page two of Learn HTML Basics will teach you how to enter markup, which is important when trying to learn html, because this is what helps format your documents.
   

HTML Basics - Page three of Learn HTML Basics will show you exactly how you can learn to create your own basic html web page.

   

Learning HTML - Page four of Learn HTML Basics aims to teach one of the more complicated portions when learning the basics of html, which is adding links.

   
Free HTML Tutorial – Is page five and the final page of Learn HTML Basics. Here you can view our closing of this article which teaches the basics of learning html, and where we recommend you can go for more advanced html tutorials.
   

HTML Form Tutorial – Learning the basics of HTML

HTML Form Tutorial

A HTML form can allow people to enter data through a web page. This data can then be processed by their computer, or sent to the web-server and processed there. HTML forms can be used in many different ways. The most common use of a HTML form is to send a search query to a search engine, as with, for example, Google. This HTML form tutorial will give you all the information you need to start making your own HTML forms.

HTML form tutorial - basic elements

Each HTML form element corresponds to a pair of HTML tags. All of these are enclosed in the form tags <form></form>. The <form> tag attributes are used to configure the behavior of the form (how the form data will be processed).

The most common HTML form element is the <input> element. By setting the 'type' attribute, you can make the input element appear in a variety of different ways. A list follows:

type="text", a text field allowing a single line of text;

type="checkbox", a single checkbox;

type="radio", a single radio button;

type="file", a file selection control which can be used to upload a file;

type="reset", this creates a special button that when pressed will clear the values in the form;

type="submit", a submit button, the action of this button is determined in the 'action' attribute of the enclosing <form> tag.

type="readonly", a text field containing text that cannot be edited, often appears dimmed/grayed;

type="hidden", a text field that is not visible to the user, its data will be processed just the same as any other HTML form element;

type="button", a general purpose button, scripting code can be attached to it so that the desired action is performed;

type="password", a text field which will not show the characters typed into it, usually they will appear as asterisks so to hide the entered text from view.

Other form elements are created using a specific tag rather than the <input> tag, these are:

<button>, a general purpose button, similar to <input type="button"> but it allows for greater variation including the use of images;

<selection list>, use this to create a drop-down list;

<textarea>, this form element creates a large box for entering multi-line text.

HTML Form Tutorial - labels

Labels are automatic for some HTML form elements, for instance buttons, but other HTML form elements like text fields and checkboxes do not have automatic labels. For these HTML form elements there is the <label> tag. Correct use of the label tag means that each label is associated with exactly one form element.

To apply a label to a form element, wrap the form element tag(s) with <label> tags. For example: <label><input type="checkbox">Label text</label>.

Another method for a applying a label to a form element is to use the 'for' attribute on the label tag. For example <label for="my_checkbox">Label text</label>. You then use a corresponding 'id' attribute on your form element: <input type="checkbox" id="my_checkbox">.

HTML Form Tutorial - access keys

Access keys allow a user to give focus to a variety of HTML elements. This occurs when the user presses the designated key on their keyboard. The operation can differ depending on the user's computer operating system; on a windows machine, the user will need to old the 'alt' key, on a Mac system the user will need to hold the 'cmd' key.

When using labels, the access key is generally attributed to the label of the form element. For instance, <label accesskey="s"><input type="text">Search:</label>. In this example, when the user presses "alt-s" on a windows machine, the focus go to search field, meaning a cursor would appear in the search field. Access keys can be set on the following elements: <a>, <area>, <input>, <label>, <legend> and <textarea>.

HTML Form Tutorial Scripting

Forms may be combined with a variety of scripting languages in order to create dynamic web sites.

With client-side scripting, the script, typically JavaScript, will run on the users web browser. The Document Object Model allows for JavaScript scripts to access the data that the user has entered. This can be useful for pre-validation, where form data is tested before being sent to the web-server. Note that a hacker can modify any pre-validation code so client side validation cannot be relied upon for security purposes.

With server-side scripting, the data is processed on the webserver. A common scripting language used is PHP, but there are many others. Server-side scripting can ensure the security of the data processing, and ensure that the data is processed the same way for every user. The 'method' attribute on the <form> element determines how the data is sent to the sever. With method="get" the data is appended to the URL, the script on the server must then anticipate this and process the data accordingly. With method="post", the data is sent directly to the webserver. Method="post" allows for no limit on the amount of data being sent, and also for the data to be encrypted. Techniques for accessing method="post" data will vary depending on the server-side scripting language being used.

Thank you to Alex Hutton for this "HTML Form Tutorial" article.

 

Latest HTML Tutorial Articles:

HTML Form Tutorial (NEW!) - An HTML form can allow people to enter data through a web page. This data can then be processed by their computer, or sent to the web-server and processed there. HTML forms can be used in many different ways. The most common use of a HTML form is to send a search query to a search engine, as with, for example, Google. This HTML form tutorial will give you all the information you need to start making your own HTML forms...

HTML DIV Tutorial - The definition of the HTML <div> tag is that it divides the HTML document into sections. The following tutorial will explain why the <div> tag is important and how it should be used. Proper usage of the <div> tag is fundamental to good HTML coding; the <div> tag is one of most powerful tools available to a Web developer...

HTML MySpace Tutorial - MySpace, one of the leading social networking websites on the internet, grows by leaps and bounds. For those that are new to the MySpace circle, there are several things that must be learned to enjoy all that it has to offer. HTML is a series of codes that are used to create website pages on MySpace, as well as change the features that are displayed. For a simple and easy to understand HTML MySpace tutorial, a MySpace account should first be created. This can be done by signing up for a free account on the website. Once an account is established and the user is logged in, the HTML changes can come into play. With MySpace there are numerous HTML codes that are used for such features as leaving comments, changing pictures, and uploading graphics for backgrounds...

HTML Frame Tutorial - The use of frames may not be as prevalent in HTML design as it once was, but it is still a worthy form of organizing your Web site and making it easy to navigate. Dividing a page using frames (called a frameset) allows the visitor to view more than one page at a time without cluttering the screen. Each frame is its own Web site and can be viewed independently in a separate window. The use of frames can be a dynamic way to get the most visual aspect out of your Web site. For example, the banner frame can be used for a business logo along with the company name. The index frame, on the left side of the screen, can be used as a table of contents, or as a place to link to other Web sites. The home frame will contain all the primary contents of the site, whose data changes each time the visitor clicks on a link. The footer frame...

HTML Table Tutorial - If you are embarking on a project to start your own Web site, you should know that the use of HTML tables will make your business or personal venture thrive. Reference any professionally produced Web site and you will find that the most successful sites use many HTML tables to draw the browser’s attention. It is identical to using colorful graphics and charts as part of a report to highlight the nuts and bolts of your presentation. Most Web sites utilize invisible HTML tables to divide the page into different sections. HTML tables can be used to create headers, menus and forms. They are also valuable for text and alignment of photos to create an organized display...

   
   
     
Copyright Learnhtmlbasics.com © 2006-2008, All rights reserved