JavaScript and form controls

Source: Internet
Author: User

JavaScript and form controls

1. form Controls

A) in HTML the form control is a tool for client and server data transfer, which collects the client's information and allows the client's users to submit data to the server in a standard format

b) <form name= "Frmname" action= "frmaction" [method= "post (default)/get" [target= "TargetType"] [enctype= ""]></form >--[] Table Optional

C

。 Name: Form names, which are convenient for controlling forms after specifying names

。 Action: Specifies the URL address of the form handler

。 Method: Specifies the way to submit the form; optional, default post

. Post: Appends form information to the URL address specified by action to form a new URL;

Between address and form information with "? Separated

Each data is connected with "&";

The URL length is limited to 8192 characters and is truncated if the sending data is too large

. Get: Separates data as separate blocks of data from URLs;

length is not limited;

Data encryption, not displayed in the address bar

。 Target: Specifies how the target document will appear after the form is submitted; optional; default _self

. _self: Open the target document in the currently used window

. _blank: Open the target document in a new window

. _parent: Open the target document in the parent window of the current window

. _top: Open the target document within the current window and ensure that the target document occupies the entire window

。 Enctype: Specifies how the form is encoded when it is submitted; optional, default application/x-www-form-urlencoded

. Text/plain: Plain Text encoding

. APPLICATION/X-WWW-FORM-URLENCODED:URL encoding, default encoding method

. multipart/form-data:mime encoding; When uploading a file, you must use

D) Events

。 OnSubmit: Submit

。 OnReset: RESET

2. text Box

A) The information in the text box is editable and you need to modify some information to use a text box to transfer data between the client and the server

b) (Single-line text box)

      1. <input type= "Text" [Name= "Txtname"] [value= ""] [size= ""] [maxlength= ""] readonly= "readOnly"/>
      2. Value
      3. Size: The input is greater than the specified size--can continue to enter and scroll to display the extra part information
      4. MaxLength: Input content length greater than maxlength--cannot continue input
      5. ReadOnly: Read-only, cannot add modified content

3. list Box

4. combo Box

5. check box

6. radio button

7. Button

JavaScript and 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.