Html:form Summary of the form, input,select,option,textarea,label__html

Source: Internet
Author: User
Tags ascii hex values
html:form Summary of the form, Input,select,option,textarea,label

<form> tags are block-level elements.

The standard properties of the form label are Id,class,style,title,lang,xml:lang.

The form can contain input elements (including button,checkbox,file,hidden,image,password,radio,reset,submit,text), menu, textarea, fieldset, Legend and label elements. The Action property indicates where the form data is sent when the form is submitted (the form data is sent to the page specified by the action attribute). The (Must) method property represents how the form is submitted. There are two ways of Get and post. The difference between get and post is found in the www.w3school.com.cn (required) Name property to specify the form's names. The Name property also provides a way to refer to a form in a script. Generally do not use JS when you can not write this property. Target attribute, the destination Enctype property that stipulates how the form should be encoded before being sent to the server. Default value: application/x-www-form-urlencoded all characters before sending (spaces are converted to plus, special symbols to ASCII hex values) and two other values, multipart/ Form-data not character encoding (must be used when using a form that contains file upload controls.) Text/plain space to the "+" plus sign, but does not encode special characters.

......................................................................................................................... .....

<input> tags are used to collect user information. The input fields have many forms depending on the type types. In-line elements. Type property Button,checkbox,file,hidden,image,password,radio,reset,submit,text. The Value property prescribes the values of the INPUT element.
For different types, the use of the Value property is different:
Type= "button", "Reset", "submit"-defines the text displayed on the button.
Type= "text", "Password", "hidden"-defines the default value for the input field.
Type= "Checxbox", "Radio", "image"-defines the values associated with the input, and submits the value to the processing page.
Note: type= "checkbox", "Radio" must set value.
     Note: The Value property cannot be used with type= "file". The Name property defines the names of the input elements; The Name property is used to identify the form data that is submitted to the server, or to reference the form data through JavaScript on the client. Note: Only form elements that have the name attribute set can pass their values when the form is submitted. The MaxLength property sets the maximum length of the input field, counting the number of characters. The MaxLength property is used in conjunction with type= "text" and type= "password". The SRC attribute (default 255) can only be used in conjunction with type= "image".   Specify the URL of the image that the Submit button displays. The Size property sets the width of the input box (some say input fields). For type= "text" and type= "password", size defines the number of western characters that can be displayed in the box, and for other types, the Size property defines the width of the input box in pixels. The Size property is recommended for use with CSS instead. The <input style= "width:100px"/> (default) ReadOnly property stipulates that the field is read-only. Read-only fields cannot be modified. However, users can still switch to the field by using the TAB key, and can also select or copy their text. The ReadOnly property prevents the user from modifying the value until certain conditions are met (for example, a check box is selected). Then, you need to use JavaScript to eliminate the ReadOnly value and switch the input field to an editable state. The ReadOnly property can be used in conjunction with <input type= "text" > or <input type= "password" >. Usage: <input type= "text" readonly= "readonly" > Disabled attributes specify that the INPUT element should be disabled. The disabled INPUT element is either unavailable or clickable. You can set the disabled property until certain other conditions are met (for example, a check box is selected, and so on). Then, you need to remove the disabled value through JavaScript and switch the value of the input element to usable. Note: The Disabled property cannot be used with type= "hidden". Usage: <input type= "text" diasbled= "disabled" > checked attributes specify the input element that should be pre-selected when the page is loaded. Checked property andType= "checkbox" and Type= "Radio" are used in conjunction with the set of preferred input elements when the load is displayed. The Checked property can also be set after the page is added through JavaScript code. Usage: <input type= "checkbox" checked= "checked" > Alt attribute to define alternate text for the image. If the image cannot be displayed, alternate text is displayed. Can only be used in conjunction with type= "image". Although the Alt property is not a required property, it should still be set at image time. If not used, it may be an impediment to a text browser or a non-visual browser. The Accept attribute stipulates the type of file submitted on the file. Can only be used in conjunction with type= "file", specify the type of upload file. Tip: Avoid using this property. You should verify file uploads on the server side. The Align property stipulates how the image is entered on its way. With type= "image" with the use. Use left and right to support all browsers. Default left, and Right,top,middle,bottom. It is recommended to use CSS instead of <input type= "image" style= "Float:left"  /> 

... ... ...... ..... ..... ..... ..... ...... ...... ....... ...... ...... ...... ... ..... ....... ...... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ... ........

<input type= "text"/> defines a single-line input field, the default width of 20 characters (Size property) MaxLength property represents the maximum number of entries in a text input box, measured in number of characters (default 255). The Value property is used to set the default value of the text box (required when the limit is needed). (Must be limited) the Size property represents the width of the text box, and for type= "text" and type= "password", size defines the number of western characters that can be displayed in the box, and for other types, the Size property defines the width of the input box in pixels. The Size property is recommended for use with CSS instead. <input style= "width:100px"/>. (Must be limited) onclick= "This.value=" event indicates that the text box is clicked, and the default content in the text box is emptied (typically used when setting the default value). The name attribute, which must be restricted, defines the names of the input elements. Name is used as a server-side identifier for HTML elements that interact with the server, such as Input,select,textarea and button. We get the value of the element commit via Request.params on the server side according to its name. If you use an ID, the server cannot get the data. If the data is not committed to the server, you can use the Name property. Another effect of name is that the client refers to the form data through JavaScript. Note: Only form elements that have the name attribute set can pass their values when the form is submitted. The ReadOnly attribute must be read-only when submitting data to the server. Read-only fields cannot be modified. However, users can still switch to the field by using the TAB key, and can also select or copy their text. The ReadOnly property prevents the user from modifying the value until certain conditions are met (for example, a check box is selected). Then, you need to use JavaScript to eliminate the ReadOnly value and switch the input field to an editable state. Usage: <input type= "text" readonly= "readonly" > or direct readonly. You can use the onclick time to empty the default values. (generally not) the disabled attribute stipulates that the INPUT element should be disabled. The disabled INPUT element is either unavailable or clickable. You can set the disabled property until certain other conditions are met (for example, a check box is selected, and so on). Then, you need to remove the disabled value through JavaScript, and the value of the INPUT elementSwitch to available. Usage: <input type= "text" diasbled= "disabled" > or direct Disabled (generally not).

1 <form>
2 Your Name:
3 <input type= "text" name= "yourname" size= "maxlength=" "value=" the length of the input box is 30, Allow maximum number of characters to "/><br>
4 <input type=" text "name=" yourname "size=" "maxlength=" readonly value= " You can only read and cannot modify "/>
5 </form>

......................................................................................................................... .....

<input type= "Password"/> defines the password field. The characters in the password field will be masked

Parameters are similar to type= "text" and have type,name,value,maxlength,size,disabled,readonly properties.

1 <form>
2 Your password:
3 <input type= "password" name= "yourpwd" size= "maxlength=" 123456 "/> Password length is less than
4 </form>

Special properties disabled the same as readonly and text.

......................................................................................................................... .....

<input type= "Submit"/> Define the Submit button. The Submit button is used to send form data to the server. The data is sent to the page specified in the action attribute of the form.

<input type= "Reset"/> define the reset button. Reset All content

Property has type,value,name,size, general values need to use type and Value property

The Value property represents the text that appears on the button.

1 <form>
2 Your name
3 <input type= "text" value= "Your Name" maxlength= "" size= "" onclick= " This.value= ' "/><br/>
4 <input type=" Submit "value=" submitted "/>
5 &nbsp
6 <input type=" Reset "value="/>
7 </form>

......................................................................................................................... .....

<input type= "button"/> defines clickable buttons, but there is no behavior. Often used to start a JavaScript program when a user clicks on a button.

Standard window Style button to implement a jump need to write JavaScript code.

The Value property is the text displayed on the button

The Name property is used for client JavaScript to manipulate data.

1 <form>
2 your button:
3 <input type= "button" value= "Yes" name= "Youinfo" onclick= "window.open" (' http ://www.baidu.com ') "/>
4 </form>

......................................................................................................................... .....

<input type= "hidden"/> define hidden fields that are not visible to the user. Hidden fields usually store a default value that can be modified by javascript

One that needs to be noticed is a wide range of uses. Usually becomes a hidden field: if there is a very important information to be submitted to the next page, but there is no time to express use.

Value in hidden is most useful. Name is used to lead to JavaScript references.

1 <form name= "Form1" >
2 Your hidden info here:
3 <input type= "hidden name=" Yourhiddeninfo "value=" Baidu.com "/>
4 </form>
5 <script>
6 alert (" The value of the hidden field is "+document.form1.yourhiddeninfo.value )
7 </script>

Alert out: The value of the hidden field is baidu.com

......................................................................................................................... .....

<input type= checkbox/> definition check box. Allows the user to select one or more of a number of

Attributes have Name,value, and specific attributes checked (required)

The most important is value, which is the value that is submitted to the page. The name value can be different, but it is recommended to use the same.

Multiple input statements make up a multiple-selection box.

1 <form name= "Form1" >
2 a:<input type= "checkbox" Name= "Checkit" value= "a" checked/><br>
3 B: <input type= "checkbox" Name= "Checkit" value= "B"/><br>
4 c:<input type= "checkbox" Name= "Checkit" Value= "C"/><br>
5 </form>

......................................................................................................................... .....

<input type= "Radio"/> Define radio buttons

Property has name,value,checked.

The name attribute must be the same, otherwise you cannot select one more. The value that is submitted to the processing page or values.

1 <form name= "Form1" >
2 a:<input type= "Radio" name= "Checkit" value= "a"

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.