Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of input method of HTML form

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you the HTML form input method example analysis of the relevant knowledge points, detailed content, clear logic, I believe that most people are too aware of this knowledge, so share this article for your reference, I hope you will get something after reading this article, let's take a look at it.

HTML form

A form is an area that contains form elements.

Form elements allow users to enter content in the form, such as text fields (textarea), drop-down lists, radio-buttons boxes, checkboxes, and so on. Forms use form tags

To set the: .input element.

HTML form-input element

In most cases, the form tag used is the input tag ().

The input type is defined by the type type. Most of the frequently used input types are as follows:

Text field (Text Fields)

Text fields are set by labels, and are used when users type letters, numbers, and so on into the form.

First name:type= "text" name= "firstname" >

Last name:type= "text" name= "lastname" >

The browser displays as follows:

First name: Last name:

Note: the form itself is not visible. Also, in most browsers, the default width of the text field is 20 characters.

Password field

Password fields are defined by labels:

Password:type= "password" name= "pwd" >

The browser displays as follows:

Password:

Radio button (Radio Buttons)

The tag defines the form radio check box option

Type= "radio" name= "sex" value= "male" > Male

Type= "radio" name= "sex" value= "female" > Female

The browser displays as follows:

Male Female

Check box (Checkboxes)

A check box is defined. The user needs to select one or more options from several given selections.

Type= "checkbox" name= "vehicle" value= "Bike" > I have a bike

Type= "checkbox" name= "vehicle" value= "Car" > I have a car

The browser displays as follows:

I have a bike I have a car

Submit button (Submit Button)

The submit button is defined.

When the user clicks the confirm button, the contents of the form are transferred to another file. The action attribute of the form defines the file name of the destination file. This file, defined by the action attribute, usually processes the input data received:

"input" action= "html_form_action.php" method= "get" > Username:type= "text" name= "user" > type= "submit" value= "Submit" >

The browser displays as follows:

Username:

If you type a few letters in the text box above and then click the confirm button, the input data will be transferred to the "html_form_action.php" page. The page displays the results of the input.

The above is all the content of this article "HTML form input method example Analysis". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report