Html journey-input field control

Source: Internet
Author: User
Tags html header

Html journey-input field control

In html learning, we will encounter a lot of learning controls. There is a type of control called an input field that can carry user input data, or change the data transmission mode or style through html.

This type of controls can be divided into four categories based on their nature: Text, button, choice, and implicit domain. Due to space issues, we will first introduce the first three types.

The correspondence between each control in the first three categories and the VB Control is as follows:

I. Text

This type of control is displayed in the form of text, and the text data entered by the user can be directly carried down and then transmitted.

1. form: form

Main attributes include action, method (get and post), type, and name.

PS: difference between get and post

1. get is to get data from the server, and post is to send data to the server.

2. get is to add the parameter data queue to the URL referred to by the ACTION attribute of the submission form. The values correspond to each field in the form one by one and can be seen in the URL. Post uses the HTTP post mechanism to place fields in the form and their content in the html header and send them to the URL address referred to by the ACTION attribute. Especially when a hyperlink is redirected, The get method loads the corresponding URL address directly to the URL where the current page is located to form a string connection. The post process directly redirects the page, and the URL in the address bar does not change, so the user cannot see this process.

3. For the get method, the server uses Request. QueryString to obtain the value of the variable. For the post method, the server uses Request. Form to obtain the submitted data.

4. Low get security and high post security. However, the execution efficiency is better than the Post method.

2. text: text Box

In this control, we can use id to uniquely identify the control, and use name to set the control name. value can set the control value (default value or displayed value ), size sets the length of the text box, And maxsize sets the maximum length. The following code is used to summarize the acceptance:

 Demo text input field                        
 Demo text
Note: When the text box is a password, you need to set the corresponding attributes so that the password is not displayed as the original code:

3. textarea: text description field

Its shape and function are similar to the listBox control, which can store a large amount of text data, while textarea can set rows and columns through rows and cols attributes.

2. Button Type

1. reset

That is, the "clear" button used by our vbprogram. The previously implemented clearing effect is only the setting of the type attribute in html:

                        


These four button controls are implemented by setting the type property. The image control is the same as the image control in VB, and the type = "button" is the most common button.

Iii. Selection

1. radio: single worker

The premise of Single-choice implementation is that all single-choice names are consistent, otherwise it will have the same effect as multiple-choice boxes.

2. checkBox: check box

3. selected

This is the control of the drop-down list, that is, the combox control used in. By default, we can only select one of the drop-down items. However, after setting the multiple attribute, we can achieve multiple selections:


                    C LanguageVB  C #Delphi


Although html is the knowledge in BS, while VB is the "old knowledge" that has just been learned in school, html can be seen as a derivative of VB: you can achieve the same effect by changing individual property controls.


Related Article

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.