HTML Journey input Field control

Source: Internet
Author: User
Tags button type html header http post

In the study of HTML, we will encounter a lot of control learning. There is a class of controls called input fields that can host the data entered by the user, change the way the data is passed through HTML, or its own style.

According to the nature of the control can be divided into: Text type, button type, select the type of three small categories:

Each of these controls corresponds to a VB control in the following representations:

First, the text type

This type of control is rendered as text and can be directly carried down by the user's input text data and then passed.

1.form: Form

The main attributes are: Action, method (get and post), type, name.

The difference between ps:get and post

1. Get is the data that is fetched from the server and post is the data sent to the server.

2. Get is the URL where the parameter data queue is added to the Action property of the submission form, and the value corresponds to the field one by one in the form, which is visible in the URL. Post is the HTTP post mechanism that places the fields within the form with their contents in the HTML header, along with the URL address referred to by the Action property. In particular, when a hyperlink jumps, the Get method loads the corresponding URL address directly to the URL of the current page, which makes up the connection to the string. And the post process will directly implement the page jump, the Address bar URL does not change any changes, so the user can not see the process.

3. For Get mode, the server side uses Request.QueryString to get the value of the variable, and for post, the server side uses Request.Form to obtain the submitted data.

4. Get security is very low, post security is high. But the execution efficiency is better than the Post method.

2.text: Text Box

In this control, we can uniquely identify the control by its ID, set the name of the control by name, value can set the control's values (by default or the displayed value), size sets the length of the text box, and maxsize sets the maximum length. The following section of code is used to accept the summary:

<span style= "FONT-SIZE:18PX;" >
Note: When we have the text box as a password entry, we need to set the corresponding property so that the password is not displayed in the original code:

3.textarea: Text Description field

It is similar in shape and functionality to a ListBox control that can hold large amounts of text data, while textarea can set rows and columns through the rows and Cols properties.

Second, Button type

1.reset

That is, we use the VB program "Empty" button, and the past to achieve this empty effect in HTML is only the Type property settings:

<span style= "FONT-SIZE:18PX;" >                        <input type= "Submit" value= "Save (Submit)" ><br>    <!--submit button--><input type= "button" Value= Save (Button) ><br>  <!--normal button--><input type= "reset" value= "Save (reset)" ><br>    <!--Reset the button for the class--><input type= "image" Src= "" >                       <!--picture button--></span>
These four button controls are implemented with the Type property's settings, where image and image control in VB are the most common buttons type= "button".

Three, the choice of type

1.radio: Radio Box

The One-box implementation assumes that all of the radio boxes have the same name, otherwise it will be the same as the multi-marquee effect.

2.checkBox: check box

3.selected

This is the control for the drop-down list, which is the Combox control used in vs. By default, we can only select one of the drop-down items, but when we set the Multiple property we will be able to achieve the multi-select effect:


<span style= "FONT-SIZE:18PX;" >                  <select name= "language" multiple >  <option value= ">c language </option><option value=" ">VB</option>  <option value=" >c#</option><option value= ">delphi</" Option></select></span>

Although HTML is a BS knowledge, and VB is just enrolled in the "old knowledge", but the HTML can be considered as a derivative of VB: The same effect can be achieved by changing individual property controls.


HTML Journey input Field control

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.