HTML form Labels

Source: Internet
Author: User
Tags html form

Forms are the most common elements of web pages, and are important means for users to interact with us, and the functions of login, registration, and information update in a website are all dependent on the form implementation. In HTML, a series of labels are provided for the form, which is the input box, drop-down box, button, and text field.

Form structure:

 <FormAction=""Method= "POST" Enctype= "Multipart/form-data" > user name: <input type= "text"  Name= "username" / < input type= "Submit"  Name= "submit button" /></form > 

As above is one of the simplest form results, what we need to master in the form structure is the properties of the form, in addition to the label associated with the form. The Action property, which points to the address of the server that handles the form, and the method property specifies how the browser handles the form, the common methods include get, POST, and the following are some of the differences we summarize about the two ways:

Get, which is faster when the form is submitted, but the data in the form is displayed in the address bar of the browser, so this is not a safe approach.

POST, this method encapsulates the form content when it is submitted, does not appear in the Address bar, so this is safer, but not as fast as the Get method.

The input box content of the form, the input box depends on the <input> tag, the different input box implementation is implemented by its Type property, the value of the Type property includes the available options include text (normal text input), Password (password box), CheckBox (check box), Radio (radio button), submit (Submit button), Reset (reset button), file (domain), hidden (hidden field), default to text.

The way the buttons are implemented in the form, either through the <button> tab or through the <input> tab, we will find that the buttons can be divided into three categories, the normal button, the Submit button, the reset button, Specifies that the button form is dependent on the Type property. It is important to note here that the <button> button specifies that the description text is the descriptive text in the label, and the <input> tag specifies that the button's description text is passed through the Value property.

Drop- down box:

<P>Province:<SelectName= "Province"><OptionSelected>---Please select---</Option><OptionValue= "0001"> Hebei Province</option> <option value= "0002" > Shanxi Province </option > <option value= "0003" > Shaanxi province </option> </select></p>    
The drop-down box makes it easy for users to enter.
text fields:
<name= "Content" cols= "$" rows= "Ten"> test </textarea  >          
Text fields allow us to enter large sections of text, note that the text field and the input box is different, the default value of the Text field is the text in the label, the input box is specified by the Value property.

HTML form Labels

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.