<input type=hidden name=field_name value=value>
effect:1 The hidden domain is invisible to the user in the page. The purpose of inserting a hidden domain in the form is to collect or send information to facilitate the use of the program that is processed. When the browser clicks the send button to send the form, the information of the hidden domain is also sent to the server.
2 Sometimes we have to give the user a message and ask him to submit it when submitting the form to determine the user's identity, such as sessionkey, etc. Of course, these things can also be implemented using cookies, but using hidden domains is much simpler. And there will be no trouble for users to disable cookies if the browser does not support it.
3 Sometimes there are multiple submit buttons in a form. How can the program distinguish which button the user pressed to submit it? We can write a hidden field, and then add onclick=document.form.command.value=xx to each button. Then, after receiving the data, we first check the command value and know that the button the user pressed was submitted.
4 Sometimes there are multiple forms in a web page. We know that multiple forms cannot be submitted at the same time, but sometimes these forms do interact with each other, so we can add hidden fields in the form to make them connect.
5 JavaScript does not support global variables, but sometimes we have to use global variables, so we can first store the value in the hidden domain, and its value will not be lost.
6 There is another example, for example, pressing a button to pop up four small windows, and the other three will automatically close when one of the small windows is clicked. However, IE does not support small windows calling each other, so you can only write a hidden domain in the parent window. When the small window sees that the value of the hidden domain is close, it will close it yourself.
Example: Use hidden to implement the number of clicking the submit button to add 1 Values increase automatically.htmCopy the code