Exclusive Offers
Become a Vistaprint Insider to receive exclusive offers and tips.
|
A Step By Step Intro to HTML Forms
HTML forms are a basic and vital tool for every web author and programmer. The forms enable end users to enter important information like name, street address, screen name, and billing information as well as using forms to search the web site in question. Each form starts with the form tag of < form > (ignore spaces) and ends with < / form >. The data contained within a, or collected from the form, is found within the < input > tag; this tag is a self terminating tag and requires no closing tag in HTML. The input tag has several attributes that can be associated with it. "Type" tells the browser and server which kind of input is being used and choices for input include 'text', 'password' and 'submit.'
It should be noted that the 'password' input type is not encrypted and should not be used for passwords. The 'name' attribute assigns a name to the given input field so it can be referred to later. "Size' sets the width for the input field on the web page measured in blank spaces and 'max-length' sets the maximum number of characters that can be entered into an input field. The 'submit' button sends the entered information to a specified location in a manner set in the 'form' attributes. The 'submit' button should always be named "send" or "submit" for continuity purposes. The 'value' attribute sets the text on the button for the web page such as 'Send' or 'Complete.'
After adding the 'submit' button, an HTML author will need to specify the location and method for sending the information. The 'method' attribute can be set to POST or GET; the GET method sends the entered information to the server via the address bar or in the HTTP request information and should never be used for secure data such as passwords or customer information. The POST Method sends the entered data separately to the server and cannot be readily seen. This is the way to send secure and sensitive information via HTML forms. The 'action' attribute specifies the destination of the information; it could be an email address, a server file, a database or any other URL.
To allow for more interaction "Radio Buttons" which are designated by the 'type' attribute can be implemented by programmers. Radio buttons are prevalent in questionnaires, surveys and ordering options and designate choices to be sent to the server for the particular information. Only one radio button may be selected from a group of radio buttons. The 'name' and 'value' attributes apply to radio buttons as well. The 'value' attribute sets the information to be sent when that radio button is selected, while the 'name' still designates how the button is referred to.
To select multiple choices from a form, check boxes need to be used. Check boxes, also designated by the 'type' attribute, use the same attributes as the radio buttons and in the same capacity. Check boxes will allow a user to select one, all or a number of different options from a list of possible answers. HTML forms also allow for the use of drop down menus as options in a list. These are created with the < select > and < option > tags; 'select' sets the list of items and 'option' is the listed item itself. Both need closing tags and the closing < / select > tag should follow the last closing < / option > tag.
HTML upload forms allow users to add images to a database or documents for others to see or use. These forms have three parts consisting of a hidden field that sets the maximum file size limit for uploading, an input field usually denoted by the 'browse button, and a script built from one of the many scripting languages available to web authors. The 'browse' button shows up automatically when "file" is selected as the input 'type.'
LINKS:
PHP Forms Upload Scripting
HTML Forms Tutorial
Javascripting in Forms
A List of Free PHP Scripts
ASP Scripting for Forms
PHP Forms
HTML Forms Tutorials
HTML PHP Forms Example
Scripting for Forms
Development Forum for PHP Scripting
|