Home  >  Article  >  Backend Development  >  Introduction to PHP form elements: selection field tags and text field tags

Introduction to PHP form elements: selection field tags and text field tags

伊谢尔伦
伊谢尔伦Original
2017-04-16 14:07:052751browse

Select field tags

A list can be created by selecting the field tags

The syntax format is as follows:

The parameter name represents the name of the selection field; the parameter size represents the number of rows in the list; the parameter value represents the menu option value; the parameter multiple represents the display of data in menu mode , the data is displayed in list mode by default.

The display methods and examples of the selection field tags

1. List mode

Running results As follows:

Introduction to PHP form elements: selection field tags and text field tags

Description: Drop-down list box, create a list by selecting the field tags

Form

consists of form elements. Commonly used form elements include the following tags: input field tags , selection field tags

2. Menu mode

The running results are as follows:

Introduction to PHP form elements: selection field tags and text field tags

Explanation: Use the multiple attribute In the menu list

Tips: In the above description, only the method of adding static menu is given. In the process of web program development, it can also be dynamically added through loop statement. Add menu items.

Text area tag

##Text area tag
"; echo nl2br($_POST['b']); ?>

HTML tag is used to obtain the

string in multi-line editing, the newline mark will not be displayed. The above example will output the following results:

Introduction to PHP form elements: selection field tags and text field tags

Note: The effect of using hard and soft line break tags is not visible on the browser and can only be selected after submitting the form. You can see the effect of executing the line break mark by executing the "right-click/view web page source code" command in the browser, or view it after conversion through nl2br()

function.

Form

consists of form elements. Commonly used form elements include the following tags: input field tags , selection field tags

The above is the detailed content of Introduction to PHP form elements: selection field tags and text field tags. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn