Home >Backend Development >PHP Tutorial >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:052943browse

Select field tags

A list can be created by selecting the field tags

The syntax format is as follows:

<select name="name" size="value" multiple>
<option value="value" selected>选项1</option>
<option value="value" >选项2</option>
<option value="value" >选项3</option>
.......
<select>

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

<select name=" lag " id=" lag ">
<option value="0" selected>PHP</option>
<option value="1" >JAVA</option>
<option value="2" >HTML5</option>
<select>

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

<select name=" lag " id=" lag " multiple>
<option value="0" selected>PHP</option>
<option value="1" >JAVA</option>
<option value="2" >HTML5</option>
<select>

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

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