"Head first HTML and CSS, XHTML"--14th XHTML form

Source: Internet
Author: User

2015-04-10 21:13:38

The 1.<input> form element, which is an empty element, is an inline element. The type attribute can have many values, "text", "Radio", "checkbox" (check box, Name property value set to the same, do not know why, later practice).

2.<textarea> is not an empty element, so it has an end tag.

After the 3.<select> element sets the Name property, its <option> item is no longer set to the Name property, and should be sent to the server, which is name= worth the data, for example, color=red;

The side-by-side options for the Radio box and check box, their Name property is the same, and the principle above, when the value of the check box is multiple, the data sent is the shape of the:color=red&green%blue;

4. Definitions and usage

The Value property specifies the values that are sent to the server when the form is submitted.

The value between <option> and <option/> is what the browser displays in the drop-down list, and the value in the Value property is the value that is sent to the server when the form is submitted.

5. Use the Checked property to define the default options. Checked= "Checked"

6. If you are using <TEXTAREA>, you should use post because you may send a lot of data. The GET request method limit can only be 256 characters, and post has no limit on the size of the data page being sent. In addition, when the form is related to private information such as passwords, do not use GET, otherwise the URL to see the information is not good.

The 7.<input> element adds the id attribute, and the <label> element adds the same value as the for= "" ID. <label> elements attach labels to form elements in a simple way

When the 8.<input> element type property is "file", you can click the transfer file to the server and you must use the Post method.

The 9.<select> element uses the multiple property and can be selected multiple.

"Head first HTML and CSS, XHTML"--14th XHTML form

Related Article

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.