HTML5 form New Properties

Source: Internet
Author: User

------------------siwuxie095

HTML5 new elements and attributes for a form

1. Form Properties

in HTML4, the form's subordinate elements must be written inside the form, and

In HTML5, you can write them anywhere on the page, and then

This element specifies a The form property, the property value is the ID of the

You can declare that the element belongs to the specified form.

2. FormAction Properties

in HTML4, all elements in a form can only be passed through the form's Action

properties are uniformly submitted to another page, while the HTML5, it can be used for all

the Submit button adds a different The FormAction property allows you to click a different button

, you can submit the form to a different page

3. FormMethod Properties

in the in HTML4, only one action property can be used in a form to

All elements in the form are uniformly assigned to the submission page, so there can only be one in each form

a Method property to unify the specified submission methods, and in HTML5, the

You can use the FormMethod property to specify for each form element

The same submission method

4. Formenctype Properties

in HTML4, the form element has a the Enctype property, which is used to

specifies how the data in the form should be compiled before the form is sent to the server

yards , while in HTML5, you can use the Formenctype attribute to table cell

Specify different encoding methods, respectively

5. Formtarget Properties

in HTML4, the form element has a the target property, which is used to

specified in where to open the page that needs to be loaded after the form is submitted, and HTML5

, you can use the Formtarget property for multiple submit buttons to specify

Where to open the page you want to load after you turn it on

6. Autofocus Properties

Add a text box, selection box, or button control The Autofocus property, when the page

When turned on, the control automatically obtains the cursor focus

7. Required Properties

In HTML5, the new required attribute can be applied to most input

element, commits are not allowed at commit, if the contents of the element are blank.

Display information hint text in the browser at the same time

8. Labels Properties

in the HTML5, for all form elements that can use labels, such as: button,

Select element, which defines a Labels property, property value is a NodeList

Object that represents the collection of label elements that the element is bound to

9. Control Property

in the HTML5, you can place a form element inside the label and

the label's Control property to access the table cell

Properties of Placeholder

in HTML5,the placeholder property is when the text box is not in the input state

Input prompt to display

Blur displays input text when the text box is not in the input state and the cursor focus is not acquired

One, List property

in HTML5, a single-line text box is added with a List property, which is the property of the

value is a ID of the DataList element

The DataList element is also a new element in HTML5, which is similar to selecting

box, but when the user wants to set a value that is not within the selection list, allow self-

Input. The DataList element itself is not displayed, but when the text box gets the focus,

Display as Prompt input

AutoComplete Properties

The auto-complete feature used to help input is a time-saving input and

very convenient function. before HTML5, because anyone can see and lose.

Value, so there is a security flaw

just use AutoComplete Property, the security aspect can be very good

The control

Thepattern Property

in the in the HTML5, the the input element uses The Pattern property, and the property

The value is set to a regular expression in a format that is checked upon submission ,

Checks whether its contents conform to the given format. When the input content does not conform to the given grid

is not allowed, and the message prompt text is displayed in the browser,

The input must conform to the given format

Properties of Selectiondirection

in HTML5, for the input element and the textarea element, an additional

The Selectiondirection property. When the user uses the mouse to select the two elements of the

You can use this property to get the selection direction when you take part of the text. When the user is

When you select text, the property value is forward, when the user reverses the selection of text

, the property value is backward, when the user does not select any text,

The property value is forward

properties of the indeterminate

for check boxes in the checkbox element, the past is only selected and not selected for two

kind of state, in HTML5, in JavaScript scripting code, you can

element uses The indeterminate property to indicate that the check box is in the "not yet clear

do you want to select " the State

the Height property and the Width property

in the HTML5, for type The INPUT element of image , which adds a new

Two properties:height and width, respectively, to specify the height of the picture button

Degrees and widths

"Made by siwuxie095"

HTML5 form New Properties

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.