1
Creating HTML Forms on Wed Jul 21, 2010 3:09 pm
Unknown Data
Registered Member

Creating HTML Forms Working with HTML forms and its elements |
This tutorial will learn you how to make forms, that can be used to collect and send information from your website. As many other things in HTML, is it quiet easy to make a form. All we have to use is a couple of tags and attributes. This code would make a text area and a send button.
This form will send a mail to name@site.com by reading further, we can learn how. Let's take a look You should always start you form with <form> and close it with </form>. In the tag we'll input some attributes (method and action), that will show us, what there is going to happen.
The attribute method can have two values, "post" and "get". The difference is by using the "get", will the information be send in the URL, while the "post" will be send hidden for the user. The "get"-method will only could send limited information (depended on the browser), where the "post"-method can send unlimited information. A form is actually nothing but some columns that can contain different information. The attribute action, is pointing on the program/script that should handle the information. Fields <input>, <select> and <textarea> is used to make fields in the form. I'll show you some descriptions of the types of fields. Textbox:
The attribute type, indicates which type of field we use. Here is we using "text", which will give a one lined text area. • With the value, can we chose a predetermined value - the text standing in the field before a user write something. • The attribute name, is used to associate a name to some information there will be written in the field. • The attribute size, indicates the length of the field. • Notice that the tag <input>, will not be closed. Textarea:
• The two attributes rows and cols indicate the height and width. • <textarea> will be closed, unlike <input>. Checkbox:
• The check boxes is fx smart to use, if we made a questionnaire etc. By inserting checked="checked" in one of the tags, would the check box be checked in advance. Radio buttons:
• Besides being round can the radio buttons be used as check boxes, but it's only possible to chose on thing at the time (notice that radio buttons in same group should have the same name). Drop-down menu:
• Drop-down menus are smart if we wish many options in small space. It's unlimited how many options we can use. • There should be using to tags to make a drop-down menu and both should be closed (<select> and <option>). • If you wish a no. as the first chosen possibility, can we use this tag: selected="selected". Password:
• It's the same as a text box, but the things written in the field would be hidden. Hidden fields:
• These hidden fields can't users not see (unless they read your codes). The user don't got a way to change the information written in the hidden fields. Buttons Send/Submit:
• By pressing this button, will the program/script be activated, that should handle this form (with the attribute action in <form>). Reset:
• This Would delete all the typed information. File:
• By pressing the button, will a listing of your hard drive, show up. The field is used by browser-based upload of files, which requires a special component installed on your server. WebArtz Online HTML Editor |
| Notice : This tutorial is copyrighted by WebArtz Forum. You may not publish it on anywhere without written permission from the administrators. |
Last edited by Unknown Data on Wed Sep 22, 2010 10:37 pm; edited 1 time in total

Home


