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)
-
- <input type= "Text" [Name= "Txtname"] [value= ""] [size= ""] [maxlength= ""] readonly= "readOnly"/>
- Value
- Size: The input is greater than the specified size--can continue to enter and scroll to display the extra part information
- MaxLength: Input content length greater than maxlength--cannot continue input
- 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