
Using Forms A form is an HTML tool that permits a visit to enter information through a browser. Below is a simple form. There several HTML components that make up a form. (Note: these are HTML components, not ASP components). A special set of HTML tags is used to indicate the beginning and ending of a form. The HTML code looks like this:
The basic form code indicates the beginning and the end of the form. All the form elements (text boxes, radio buttons, etc) go between the <form></form> tags. The name is used for reference. If you have several forms on one page, naming each one will make it easier to keep track of which form is doing which process. The "method" can be one of two options-- either get or post. Get is used when all the information is passed to the next page via URL strings. To see a form like this, go to Google, and search for something. Your search criteria will be transferred to the URL. This is because Google uses the get method in its search form. Post does not use the URL to pass information. Instead, the next page requests each form element through "form request" commands. The result is a cleaner URL. The method you select is dependent on the kind of information you want to show up in the URL. If you are passing password to the next page, the get method should never be used. If you want a person to be able to bookmark a resultant form (as Google probably does), you should use the get method. In most cases, the method is not critical, so you are free to use the method you prefer. The "action" is the result of activating the form. Activation is usually accomplished by clicking a "submit" button, as in the example above. Normally the action points to a new web page which processes the form elements, and shows the result.
|