Introduction to PHP form elements-input field tag <input>

Source: Internet
Author: User
Tags php form
Form & lt; form & gt; consists of form elements. Common form elements include the following tags: input field tag & lt; input & gt;, selection field tag & lt; select & gt; and & lt; option & gt;, text field Mark & lt; textarea & gt;, etc. Form

Parameter name refers to the name of the input field, and parameter type refers to the type of the input field. In The following types of input fields are provided in the tag. you can use the type attribute to select a type based on your needs.


Type attribute values and examples:

1. text

Instance:

 

Note: name indicates the name of the text box. value indicates the default value of the text box. size indicates the width (in characters) of the text box. maxlength indicates the maximum number of input characters in the text box.

4. radio

Instance:

MaleFemale

Note: The single-choice button is used to set a set of selection items. you can select only one item. the checked attribute is used to set this single-choice button to be selected by default.

5. checkbox

Instance:

BooksFruitFood

Note: the check box allows you to select multiple options. The checked attribute is used to set the check box to be selected by default. For example, when collecting personal information, you need to make multiple choices in the options of personal interests.

9. hidden

The instance is as follows:

 

Description: hidden fields are used to implicitly submit variable values in the form. Hidden domains are invisible to users on the page. the purpose of adding hidden domains is to collect or send information in a hidden manner. When a viewer clicks the send button to send a form, information about hidden fields is also sent to the processing page specified by action.

The above is the input domain markAndExamples of the type attribute show that friends need to remember this and perform more operations, because forms will be very useful in future development.

The above is the input field mark of PHP form element introduction.For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.