Home > Article > Web Front-end > What is the role of forms in the web front-end?
The form has two functions: 1. For users, it is an interface for data entry and submission; 2. For websites, it is a way to obtain user information. A form has three basic components: 1. The form tag, which contains the URL of the CGI program used to process the form data and the method for submitting the data to the server; 2. The form field, which includes the text box, password box, hidden field, and multi-line text boxes, etc.; 3. Form buttons, including submit buttons, reset buttons and general buttons, are used to transfer data to CGI scripts on the server or cancel input, etc.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
Forms in the web front-end
The form’s role in the web page cannot be underestimated. It is mainly responsible for the data collection function. For example, you can collect Visitor's name and e-mail address, questionnaire, guestbook, etc.
The role of the form:
For the user, the form is an interface for data entry and submission;
Forms are a way for websites to obtain user information.
A form has three basic components:
Form tag
The form tag is used to create an HTML form for user input (form fields ) to realize the collection and delivery of user information, and all content in the form will be submitted to the server. The form form field can contain various interactive controls - control labels (text fields, check boxes, radio boxes, submit buttons, etc.), such as , , < ; select>, and other tags.Some attributes of the input tag:
The checked attribute is only available for radio buttons and check boxes
Attribute value | Description | |
---|---|---|
Text | Single line text input box | |
Password |
Password input box | |
Radio |
Radio button | |
Checkbox |
Checkbox | |
##Button | Normal button||
Submit | Submit button||
Reset | Reset button||
Image | Submit button in image form||
Text field |
name | |
The name of the space | value | |
Default text value in the input control | size | |
The display width of the input control on the page | checked | |
##Define the default selected items in the selection space | ||
The maximum number of characters allowed to be entered by the control |
The above is the detailed content of What is the role of forms in the web front-end?. For more information, please follow other related articles on the PHP Chinese website!