To be honest, whether it is Asp, PHP or JSP for network programming, it is inseparable from interaction with users.
The human-computer dialogue platform basically relies on the corresponding text and list boxes for input, and then submit it to the database through buttons.
Therefore, when learning network programming, you must understand these input platforms related to:Form (form)
The basic format is as follows:
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
It can be summarized: the form includes relevant content within <form>...</form>.
There are three categories:input,select,textarea
First, look at the internal parameters of <form>
Parameter name: Used to represent the unique name of the form, which facilitates the creation of multiple forms on a page without confusion, and of course, it is to accept the confirmation relationship of the page.
Parameter action: Obviously, it means that all content in the current form will be sent to a certain page for processing. Processing includes acceptance of information, database comparison, addition, modification, etc.
Parameter method: that is, the form submission method, including two methods: post and get. Post is to transmit information content, get is to transmit url value. The specific usage will be introduced in the next section "Built-in Object Request".
Second, let’s look at Input related
Input represents an input object in a Form form, which is divided into text input boxes, password input boxes, single-choice/check boxes, submission/reset buttons, etc. depending on the type of type. The following is introduced one by one.
1,type=text
The input type is text, which is the most commonly used one we have seen and used, such as logging in to enter a username, registering to enter a phone number, email, home address, etc. Of course, this is also the default type of Input.
Parameter name: Also represents the name of the text input box.
Parameter size: The length of the input box.
Parameter maxlength: The maximum number of characters allowed in the input box.
Parameter value: the default value in the input box
Special parameter readonly: means that only display in this box, no modification can be added.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
2,type=password
Needless to say, the biggest difference between a password input box that you can understand at a glance is that it is displayed as a confidential character when inputting information in this input box.
The parameters are similar to "type=text".
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
3,type=file
Things that are indispensable when you upload images in BBS and upload attachments in EMAIL :)
Provides a platform for inputting files directory, with parameters such as name and size.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
4,type=hidden
A very noteworthy one, commonly known as a hidden domain: if a very important information needs to be submitted to the next page, but cannot or cannot be explicitly stated.
In a word, you can't see where hidden is on the page. The most useful thing is the value of hidden.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
5,type=button
A standard windows-style button, of course, to make the button jump to a certain page, you also need to add JavaScript code.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
6,type=checkbox
Multiple selection boxes are often used to select hobbies, personality, and other information when registering. Parameters include name, value and special parameter checked (represents the default selection)
In fact, the most important thing is the value value, which is the value submitted to the processing page. (Appendix: The name value can be different, but it is not recommended.)
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
7,type=radio
That is, the single box appears in the multiple-choice page settings. The parameters also include name, value and special parameters checked.
Unlike checkbox,The name value must be the same, otherwise you can't choose one more. Of course, the value value submitted to the processing page is still submitted.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
8,type=image
A more alternative, just check the effect yourself, it can be used as a submission image
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
9,type=submit and type=reset
The two buttons "Submit" and "Reset" are respectively
The main function of submit is to submit all content in Form to process the action page, and reset will quickly clear all contents.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
There are 10 types of Input, but there are still many, haha
3. Let’s look at the Select related
Select mainly involves drop-down menus, jump menus, and (drop-down) lists.
It has the embedded code <option>...</option> itself. The value of the option parameter is the value passed to the processed value. The option also has the parameter selected, indicating that it is selected by default.
1. Pull down menu
Just a menu-style display.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
2. Jump the menu
Add JavaScript to the drop-down menu to become a jump menu.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
3. Drop-down list
The biggest difference between the drop-down menu is that select has an additional size value, which is not the length, but the upper and lower heights of the list.
Of course, there is more important thing: you can only choose one menu, and you can choose multiple lists. This special parameter is multiple
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
Four, the last textarea to pay attention to
The Textarea text area can be understood as an enlarged text input box.
Its parameters do not have a value, and the default value is set between <textarea>...</textarea>.
Other parameters include rows, which represents the number of rows in the text area; Cols, which represents the number of columns in the text area.
There is also the parameter warp. When warp=off means that the text area does not wrap automatically. Of course, if you don’t write, it will wrap automatically by default.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
Final summary:input is divided into 10 categories according to type, select from option and then divides menu and list, textarea with rows and columns text input area
Two articles worth recommending
Fancy forms:/tech/web/2003/
Form effects:/blog/?cat_id=5&log_id=271
The human-computer dialogue platform basically relies on the corresponding text and list boxes for input, and then submit it to the database through buttons.
Therefore, when learning network programming, you must understand these input platforms related to:Form (form)
The basic format is as follows:
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
It can be summarized: the form includes relevant content within <form>...</form>.
There are three categories:input,select,textarea
First, look at the internal parameters of <form>
Parameter name: Used to represent the unique name of the form, which facilitates the creation of multiple forms on a page without confusion, and of course, it is to accept the confirmation relationship of the page.
Parameter action: Obviously, it means that all content in the current form will be sent to a certain page for processing. Processing includes acceptance of information, database comparison, addition, modification, etc.
Parameter method: that is, the form submission method, including two methods: post and get. Post is to transmit information content, get is to transmit url value. The specific usage will be introduced in the next section "Built-in Object Request".
Second, let’s look at Input related
Input represents an input object in a Form form, which is divided into text input boxes, password input boxes, single-choice/check boxes, submission/reset buttons, etc. depending on the type of type. The following is introduced one by one.
1,type=text
The input type is text, which is the most commonly used one we have seen and used, such as logging in to enter a username, registering to enter a phone number, email, home address, etc. Of course, this is also the default type of Input.
Parameter name: Also represents the name of the text input box.
Parameter size: The length of the input box.
Parameter maxlength: The maximum number of characters allowed in the input box.
Parameter value: the default value in the input box
Special parameter readonly: means that only display in this box, no modification can be added.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
2,type=password
Needless to say, the biggest difference between a password input box that you can understand at a glance is that it is displayed as a confidential character when inputting information in this input box.
The parameters are similar to "type=text".
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
3,type=file
Things that are indispensable when you upload images in BBS and upload attachments in EMAIL :)
Provides a platform for inputting files directory, with parameters such as name and size.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
4,type=hidden
A very noteworthy one, commonly known as a hidden domain: if a very important information needs to be submitted to the next page, but cannot or cannot be explicitly stated.
In a word, you can't see where hidden is on the page. The most useful thing is the value of hidden.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
5,type=button
A standard windows-style button, of course, to make the button jump to a certain page, you also need to add JavaScript code.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
6,type=checkbox
Multiple selection boxes are often used to select hobbies, personality, and other information when registering. Parameters include name, value and special parameter checked (represents the default selection)
In fact, the most important thing is the value value, which is the value submitted to the processing page. (Appendix: The name value can be different, but it is not recommended.)
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
7,type=radio
That is, the single box appears in the multiple-choice page settings. The parameters also include name, value and special parameters checked.
Unlike checkbox,The name value must be the same, otherwise you can't choose one more. Of course, the value value submitted to the processing page is still submitted.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
8,type=image
A more alternative, just check the effect yourself, it can be used as a submission image
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
9,type=submit and type=reset
The two buttons "Submit" and "Reset" are respectively
The main function of submit is to submit all content in Form to process the action page, and reset will quickly clear all contents.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
There are 10 types of Input, but there are still many, haha
3. Let’s look at the Select related
Select mainly involves drop-down menus, jump menus, and (drop-down) lists.
It has the embedded code <option>...</option> itself. The value of the option parameter is the value passed to the processed value. The option also has the parameter selected, indicating that it is selected by default.
1. Pull down menu
Just a menu-style display.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
2. Jump the menu
Add JavaScript to the drop-down menu to become a jump menu.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
3. Drop-down list
The biggest difference between the drop-down menu is that select has an additional size value, which is not the length, but the upper and lower heights of the list.
Of course, there is more important thing: you can only choose one menu, and you can choose multiple lists. This special parameter is multiple
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
Four, the last textarea to pay attention to
The Textarea text area can be understood as an enlarged text input box.
Its parameters do not have a value, and the default value is set between <textarea>...</textarea>.
Other parameters include rows, which represents the number of rows in the text area; Cols, which represents the number of columns in the text area.
There is also the parameter warp. When warp=off means that the text area does not wrap automatically. Of course, if you don’t write, it will wrap automatically by default.
[Ctrl+A Select all to copy Tip: You can modify some code first, then click Run]
Final summary:input is divided into 10 categories according to type, select from option and then divides menu and list, textarea with rows and columns text input area
Two articles worth recommending
Fancy forms:/tech/web/2003/
Form effects:/blog/?cat_id=5&log_id=271