"HTML" 3.Form form

Source: Internet
Author: User

label

Form elements

Label

Describe

text box

<input type= ' text ' ...>

Enter a line of text

Password

<input type= ' password ' ...>

Enter a line of text, but not visible, with asterisks only

Unit button

<input type= ' Radio ' ...>

Only one option can be selected

check box

<input type= ' checkbox ' ...>

You can select one or more options

Hidden fields

<input type= ' hidden ' ...>

The value of the field is not visible to the user but is submitted to the server

drop-down list

<select ...>

<option ...> ... </OPTION> ( can put multiple OPTION)

</SELECT>

Text field

<textarea ...>...</textarea>

Multiple lines of text can be entered

Submit button

<input type= ' Submit ' >

Submit Form

Normal button

<input type= ' button ' >

Reset button

<input type= ' reset ' >

Reset form Information

Introduction

Basic function: Collects the data that the user fills in, then submits to the server.

The form field for which you want to submit data must have the Name property. Otherwise, the form field's data is not submitted to the server.

Text box:

<inputtype= "text" name= "uname" value= "333" size= "ten" maxlength= "/>"

Password box: (basically consistent with the use of text boxes, except on the page with asterisks)

radio button (for multiple-choice cases):

Gender:

<input type= "Radio" name= "Gender" value= "1"/> Male <inputtype= "Radio" name= "Gender" value= "0"/> Female
1. Radio buttons are grouped, and name is the same group. Only one button can be selected in a group.

2.value: If you do not increase the Value property, check the button submit Shime think: On, not an empty string. Therefore, it is recommended that you use the radio button to specify value.

check box (for multiple-choice cases):

Like programming languages:

<br/>      <inputtype= "checkbox" Name= "Favorite"/>  JAVA      <inputtype= "checkbox" Name= " Favorite "value=" 2 "/>  C + +      <inputtype=" checkbox "Name=" Favorite "value=" 3 "/>  RUBY      < inputtype= "checkbox" Name= "Favorite" value= "4"/>  C
3. Check boxes are grouped, and name is the same group. Multiple check boxes can be simultaneously

4.value: If you do not increase the Value property, check the button submit Shime think: On, not an empty string.

5. The selected option is passed to multiple parameters with different values of the same name.

Drop-down list (for more than one or more select multiple effects.) ):

Nationality:

<br/>      <selectname= "Country" multiple>               <option>China</option>               < Optionvalue= "2" >America</option>               <optionvalue= "3" >France</option>                        </select>
1. When <option> does not specify the Value property. If selected, the prompt text in <option> is submitted instead of on or an empty string.

Note: The radio button, check box is selected by default: Checked property. The drop-down list uses the: Selected property.

Hidden fields:

Multiline text fields:

<textareaname= "Introduce" rows= "4" cols= ">"  </textarea>

Reset button: Restores the values of individual form fields to their default values.

Submit button: submits the form data.

Picture button: Submits the form data and submits the form by clicking on the specified picture. For example:

<inputtype=image src= "1.jpg"/>

Form form:

Form: A form field used to collect user information.

Action: Who the form data is submitted to

Method: How to submit

file:///D:/Summary/html--20160410/html-form-01.html?uname=akali&pwd=123123

Get method: Stitching behind the URL, the data is visible, and is not secure, the amount of data is small.

Features: Use the question mark to stitch in the back of the URL, the form of key-value pairs, and the key-value pairs used & separated.

Post method: Security, large amount of information.

Rely on the Name property to determine whether the data is committed.

1. When using the radio attribute, pay attention to the concept of group, which is controlled by the Name property.

Same name and a group can only select one

2. When using the Radio property, be aware of value values that require different values for the same set of value

The use of Arabic numerals is generally recommended.

Demo

Business Ideas

Form forms are an important part of learning HTML, especially for designers of foreground and background interaction, and are more familiar with the use and design of forms.

Generally speaking, form form is very simple, but careful every step of the design, every operation. Practice more and use it for endless.


"HTML" 3.Form form

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.