In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what the basics of HTML forms are, and the editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
HTML forms are used to collect different types of user information. Tags define the form, which is an important means for HTML pages to interact with the browser.
The processing of form information: when the submit button of the form is clicked, the information entered in the form will be uploaded to the server and then processed by the relevant application of the server. after processing, the information submitted by the user may be stored in the server-side database, or the relevant information will be returned to the client browser.
For a piece of information, we need to know something. For the form, what we submit, who we submit it to, how we submit it, and how we react after submission.
So several attributes of the form tag accomplish the above task. The form tag has five attributes: name,method,action,enctype,target.
Name: the name of the form, which controls the relationship between the form and the daemon by naming it. Method:method has two values, get and post. The get method appends the form content to the URL address, and the post method includes the data filled in the form in the subject of the form. The get method has a length limit, and if it is too long, it may be truncated, and the url is displayed, so the security of get is not as good as that of post. Literally, get is supposed to be used to get something, while post is to mail something. Action: used to define the location of the form handler, which is actually where we send the form.
So simulate Baidu search window.
The reason is to use Baidu to search Zhihu.
You can see that s is the submitted address, and wd is the name of input set by Baidu, so we write our own form and pretend to be the entrance of Baidu to use Baidu to search.
Enctype: sets the encoding method for form information submission. There are several target types: set the window returned by the form. There are several kinds of target values
Next are the controls for form, that is, the various tools for gathering information. The information submitted by the form form is submitted in keyword:value format, so each control must have two properties, name,value. Name is named for us, such as wd named by Baidu above. While value needs to look at the control, if it is a control that needs to enter content, such as a text input box, then value is the value entered by the customer, and if it is a box / drop-down menu, we set the vlue value ourselves.
The name is named by the developer, and the value is obtained by customer input. The placeholder attribute indicates the information entered by default
Ditto.
Ditto.
Name/value is named by the developer and is not displayed on the page. It is used to temporarily store some information and can be used for certain security settings.
Normally, the radio box provides several options, and you can only select one of them, such as the image above. You must keep several options consistent with name, and the value value is named in advance.
You can choose more than one, and the name must be consistent. Value is named in advance, checked means it is selected by default, and the radio box can also use this property value.
For the drop-down menu, the same two properties need to be set in advance. The selected attribute indicates that it is selected by default.
The next step is to submit the form. In html, you can choose to submit the form as follows
The tag defines a button that does not contain data itself and will submit the form information as soon as you click it.
Tags can place content, such as text and images.
There are also several attributes: name/type/value. Under IE, the default value for type is button, and the default value is summit in other browsers. So for compatibility, type=summit should be set when writing. When clicked, the content of the name,button is also submitted as form data if it is set. And the content submitted by different browsers is also different. IE browsers submit text between button tags, while other browsers submit value attributes.
This is a button, and if you don't write javascript, nothing will happen.
It is also a button that will directly submit the form information when clicked.
If name is set
You can see that the value of the same button itself is also submitted.
On "what are the basics of HTML forms" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.