Forms are one of the more complex objects that we can add to our web pages. Instead of a single tutorial on adding forms I have instead decided to write a series of tutorials that start by showing you how to create a form that has nothing but a submit button and we will gradually add additional fields of different types until we have covered all of the different types of fields that we can add.
Here's what the Single Button Form page looks like in your web browser.
All form fields in XHTML must be contained within a form container. The form container must have an action attribute that indicates the action that is to be taken if the form is submitted. If a form is being used for a purpose that does not require that it ever be submitted then the action attribute is still required but can contain a simple placeholder (action="#").
The method attribute is required when the form is one that will be submitted and is not required if the form will not be submitted. The method attribute controls how the form fields are submitted. If method="post" then the form fields are passed in the HTTP header to the following web page. That page must support some form of server side processing in order that the posted fields can be extracted and made available in the page. The alternative method="get" passed the fields in a query string added to the end of the address of the next page. The query string follows the ? that the form adds to the end of the address in the action attribute and consists of a series of field=value entries separated by ampersands.
While not mandatory the value attribute will be entered for most input fields to define the value associated with the field. Depending on the type of input field this value may or may not be displayed on the page and may or may not be updatable. In the case of a submit button the value is displayed as the text in the button.
This article written by Stephen Chapman, Felgall Pty Ltd.