Some of the common form controls

Source: Internet
Author: User

form: Used to display collected information and submit information to the server)
1. Table cell <form ></form>
Main properties: Action: Where to send form data when the form is submitted, property value is a URL
Method: How to send form data to the page specified by the Action property (get Post)
Enctype: How the form data is encoded
Name: Form names
2. Form CONTROLS:
(1).<input>The element is used to collect user information as a single token.
Primary property: Type: You can create various types of input fields depending on the value of the type attribute
Value: Data for the control
Name: Names of controls
(2). text box and Password box: <input type= "text"/>
<input type= "Password"/>
Main attribute: Value: Any text entered freely by the visitor
maxlength; Limit the number of characters entered
ReadOnly: Set text control read-only
(3). Radio Box and check box:Radio box <input type= "Radio"/>
check box <input type= "checkbox"/>
Primary property: Value: Text, when the form is submitted, the radio button is selected, and value is sent to the server
Name: Used to implement grouping, a set of radio boxes or check boxes must have the same names
Checked: Set selected
(4).ButtonSubmit button <input type= "Submit"/> Transfer form data to server or other program processing
Reset button <input type= "reset"/> clears form contents and sets all form spaces to default values
Normal button <input type= "button"/> used to execute client script (JavaScript will be used)
Main attribute: Value: Caption text of the button
(5).Hide fields and file selection boxes
Hidden fields: <input type= "hidden"/> contains information that you do not want users to see in the form
File selection box <input type= "file"/> Select files to upload
(6).<label></label>element to associate text with a control, click the text, and the effect is the same as clicking the control
Eg: <body>
<form action= "savedata.aspx" method= "post" ><br/>
<input type= "checkbox" Name= "Chkhid" id= "Chkhid"/>
<label for= "Chkhid" > do not disclose my information </label>
</form>
</body>
(7).Options Box (drop-down box and scrolling list)
Select element: Use it to create an option box and use the <option> element to create each of these options
The properties are: Name: Name the option box.
Disabled: Disables the control, and the value of this property is "disabled".
Size: A value of 1 o'clock is a drop-down option box with a value greater than 1 for scrolling the list
Multiple: Allows the user to select multiple options at the same time. If this property is not set, only one option can be selected.
The <option>:<select> element needs to contain at least one <option> element, which represents an option.
The attributes are: value: The values of the options. If selected, the value of this property is sent to the server.
Disabled: Specifies that an option should be disabled. The disabled option is neither available nor clickable.
Selected properties: The preselected options appear at the top of the drop-down list.
(8).<textarea> Elements: A text input control for creating multiple lines that can hold an unlimited amount of text in the text area
The properties are: Name: Sets the names of the controls that are used to provide a name/value pair to send to the server.
The Cols:cols property is used to define the width of the text area (in the average number of characters).
The Rows:rows property is used to specify the height of the text area (in rows).
Disabled: Disables the control, the disabled text area control is neither available nor clickable.
ReadOnly Property: Specifies that the multiline text box is read-only and the content cannot be modified.

Some of the common form controls

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.