HTML input tags and form labels

Source: Internet
Author: User
Tags button type html form

Input label

The input tag is closed by itself

<input/>


Input series has checkbox, Redio, Password, button, file, etc.


1. type= ' text ' and type= ' password '

<input type= ' text '/>

Type= ' text ' and type= ' password '

User name: <input type= "text"/><br/><br/> Password: <input type= "Password"/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/8C/CE/wKiom1h4jtDzlFmhAAAj8wuCrnk811.png "title=" 1.png "alt=" Wkiom1h4jtdzlfmhaaaj8wucrnk811.png "/>

Limit input Length: type= ' text ' maxlength= "3"

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8C/CF/wKiom1h4lwrhYQYiAAAi_JGEHZY731.png "title=" 1.png "alt=" Wkiom1h4lwrhyqyiaaai_jgehzy731.png "/>



2. check box: type= ' checkbox '

Interests: Basketball: <input type= "checkbox"/> soccer: <input type= "checkbox"/> Volleyball: <input type= "checkbox"/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8C/CA/wKioL1h4j9yja85MAAAhpCO3E8s333.png "title=" 1.png "alt=" Wkiol1h4j9yja85maaahpco3e8s333.png "/>


3. Radio button type= ' Radio '

Gender: Male: <input type= "Radio" name= "Gender"/> Female: <input type= "Radio" name= "Gender"/>

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/8C/CE/wKiom1h4kF3jv6gmAAAZ6qFOwq0847.png "title=" 1.png "alt=" Wkiom1h4kf3jv6gmaaaz6qfowq0847.png "/>

4. Submit button: type= ' button '

button- Normal button,submit-Submit Button, Submit buttons generally appear on the Web page need to submit information to the server is only used, and button is to create a button, for the implementation of the button will be what happens this does not necessarily depend on the page editor, for example, on the same day page form, user input may input errors or deviations, You can create a button-clear (reset) button on a Web page, a form can have multiple normal buttons, and at least one submit button (to submit a form page )

<input type= "button" value= "Submit"/>

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/8C/CE/wKiom1h4kL6xIcA0AAAU3P-fdS8014.png "title=" 1.png "alt=" Wkiom1h4kl6xica0aaau3p-fds8014.png "/>


5. Submit button: Type= ' Submit '




6. Uploading files: type= ' file '

<input type= "File"/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/8C/CE/wKiom1h4kS6C10XhAAAZNvWg65g539.png "title=" 1.png "alt=" Wkiom1h4ks6c10xhaaaznvwg65g539.png "/>

7, multi-line output box:

<textarea> Here you can enter multiple lines of information </textarea>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8C/CF/wKiom1h4mweQYqjQAAAbMJCHQB4234.png "title=" 1.png " alt= "Wkiom1h4mweqyqjqaaabmjchqb4234.png"/>


Form Label:

<form action= "" method= "get" > </form>
Or
<form action= "" method= "post" > </form>

When the value of method is get, the content and parameters are passed through the URL, and this time we can see ourselves fill in the content submission processing through the URL URLs.

When the value of method is post, the content and parameters are filled out via a similar cache, and the URL is not visible when the form form fills in the content submission.

For HTML form form labels, you have a form form and a Submit method (get Post) (to understand the get post differences) in order to transfer the data to the program processing, or the program cannot receive the data that will be processed.


The difference between button and submit:

The button in the form does not submit the data in the form (unless it is customized, for example, with JS), submitwill commit the data .

Name: <input type= "text" maxlength= "ten"/> Password: <input type= "password"/><br/><br/><input type= "Submit" onclick= "alert (123)" value= "Commit"/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/8C/CC/wKioL1h4pALj6vtAAABaDxPbvS8462.png "title=" 1.png "alt=" Wkiol1h4palj6vtaaabadxpbvs8462.png "/>


Since submit can submit data, why should there be a button?

Submit the method for the From is post, he is to submit the data to the background, and the button corresponding to the method is get, such as the page plus a button,value set to refresh, then the meaning of the button is to refresh the page, without submitting any data to the background.









HTML input tags and 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.