September 30, 2015 HTML form notes

Source: Internet
Author: User

ASP. NET is a house, so HTML is the brick inside.

The form is very important, why use the form? Because the form can transfer data to the server.

Generally use form forms to transfer data.

The execution model of the BS program is that the personal computer fills the form with special data and then uploads it to the server, the server processes the resulting data, and then packages the result into HTML code and sends it back to the PC, which is parsed and displayed by the browser.

A form is a label used for data submission.

The form is a pair of form tags, containing some other tags, input, etc.

<form> generally in the form tag content will be used as data package transmission, or use JS transmission, and outside the form is not used as data transmission </form>

<form> Properties: The action represents the submission of the target server, method submitted by methods get, Post,enctype upload file.

Basic format for form elements:

<input name= "FORM element name" type= "type" value= "value" size= "Display width" maxlength= "max Length" checked= "Check"/>

Form element name = Control Name, type = specified element type, can be text, radio, submit, etc., value = initial value of control, display width = initial width of control, maximum length = maximum number of characters entered in the control, whether or not the control is selected checked.

<form action= "http://www.baidu.com/s" method= "Get" >

<!---form submissions have get and post points

Get is the default, which is to use a browser address for data submission

Post is what will be submitted hidden in the message to commit

The action is the goal of the submission, which is where you jump when you click Submit.

-

<!-Write a text box--

<input type= "text" name= "JK" value= "fill in the content here"/>

<!-

To submit data, two conditions must be met

    1. Put it in the form
    2. You must have the name and Value property. To submit is to add name, to display the contents of the text box will add value.

-

<!-readonly can only be read and not written--

<input type= "text" value= "readonly" readonly= "ReadOnly"/>

<!-maxlength limit How much text is entered in the text box, such as 6, you can only enter six--

<input type= "text" value= "" maxlenght= "6"/>

<!-size control the length of the text box--

<input type= "text" value= "" size= "1"/>

<!-Password box label--

<input type= "password" name= "pwd" value= "/>

<!-hidden is used to record the information when the page jumps, but because the information should not be displayed on the page, if the display will break the entire page appearance and so on, so use hidden tags to hide it-

<input type= "hidden" value= "Sdfadfadfadfas"/>

<!-The Text field label, the text field label will save the format intact as the pre tag. -

<textarea rows= "Ten" cols= ">" Fonts in text fields </textarea>

<!-Write a Submit button--

<input type= "Submit" name= "btn"/>

<!-in the Form tab, all of the label formats, such as HTML, are treated as if they were outside the form. The form only provides the conditions for the data submission, and the others are the same as the original.

</form>

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

<input type= "reset"/> reset button Label

<input type= "button"/> Buttons tab

<input type= "image" src= "URL"/> Image label

<input type= "button" value= "You Dot Me" disabled/> button appears, but cannot be clicked.

<input type= "checkbox"/> check box

<input type= "checkbox" checked/> check box tick

<input type= "checkbox" Id= "CC"/><label for= "CC" > Sleep </label>label You can bind a certain data to a control by first adding an id attribute to the target tag. Then add the label label and use the For property to specify the ID

Download the authoritative Guide to HTML and XHTML

Single-Selection labels

<input type= "Radio" name= "R"/> Male

<input type= "Radio" name= "R"/> Female

<input type= "Radio" name= "R"/> Others

September 30, 2015 HTML form notes

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.