One . Form Tags:<form> Form labels are the most commonly used labels for interacting with the server side. <input>: Input tag: Receive user input information. The type attribute in the specified input label. L textbox text. The text information you enter is displayed directly in the box. L Password box password. The text you enter is displayed in the form of an origin or an asterisk. L Radio box Radio such as: Gender selection. L check box checkbox like: Interest selection. The hidden fields hidden not appear on the page, but are submitted with other content when submitted. Submit button Submit for submitting the contents of the form. Reset button Reset sets the contents of the form to the initial value. L button buttons can customize events for them. L Files upload file post-extension content, automatically generates a text box, and a browse button. L image It can replace the submit button. <select>: Select the label to provide user selection. Such as: The Provinces and cities where the user resides. The Size property displays the number of items. <OPTION>: The subkey Label property selected has no attribute value, plus on the subkey, on one of the subkeys, the subkey becomes the default option. <textarea>: Multiline text box. such as: Personal information description. <label>: Used to define shortcut keys for each element. For property: Specifies the form element that the shortcut key acts on. Must be the same as the ID value of the form element you want to work with. accesskey Property: Specifies a shortcut key that needs to be combined with the ALT key. Cases: <label for= "User" accesskey= "U" > Username (u) </label> <input type= "text" id= "user"/> Form submission: 1. Define the Action property value in the Form form to specify the destination of the form data submission (server side). 2. Explicitly submitted by specifying the method property value. If not defined, then the value of method is default to get. The difference between the two most common ways to submit a Get and post: 1. Get commits display data in the address bar and are not secure for sensitive information. Post submission is not displayed in the address bar, for sensitive information security 2. The data stored in the Address bar is limited, so the Get method has a limit on the volume of data submitted. Post can submit large volumes of data. 3. There are different ways to encapsulate the submission data: Get: Encapsulates the commit data into the first line of the HTTP message header, in the request line. Post: Encapsulates the submitted data into the message header, in the request data body. Note: Usually the form is submitted using post because it is easy to encode. For the Tomcat server side, the default decoding method is Iso8859-1, then the Chinese will appear garbled. With post submission, you can use Request.setcharacterencoding ("GBK") to solve the garbled problem, which is only valid for the data body. If it is a get commit, request.setcharacterencoding ("GBK") This method to garbled can not solve, must first iso8859-1 encoding, and then in the GBK decoding. This way although the garbled for post submission is also common, but troublesome. So create a form submission using post. |