Home  >  Article  >  What can be used to control the format of input data in a text box

What can be used to control the format of input data in a text box

藏色散人
藏色散人Original
2021-05-08 14:10:313300browse

The input mask can be used to control the format of input data in the text box. "Input mask" refers to the characters that can control the input of data into the field. An input mask can include literal display characters and mask characters.

What can be used to control the format of input data in a text box

The operating environment of this article: windows7 system, DELL G3 computer

The input mask can be used to control the format of the input data in the text box. Validation rules are constraints that should be followed when entering data into a table.

"Input mask" refers to characters that can control the input of data into a field. An input mask can contain literal characters (such as brackets, periods, spaces, hyphens, etc.) and mask characters.

Input masks are mainly used for text and date fields, but can also be used for numeric and currency fields. For example, set the input mask of the "date of birth" field to "****year**month**day". Each "*" sign is called a "placeholder". The placeholder must use special characters (such as *, $ or @, etc.). It only occupies a position in the form, indicating that one digit can be accepted: and the "year, month, and day" are the original meanings. Display characters.

Character meaning

The meaning of the characters used in the input mask attribute is as follows:

0: You must enter a number (0-9), no The plus and minus signs - are allowed.

9: You can choose to enter numbers or spaces, plus and minus signs are not allowed.

#: You can optionally enter numbers or spaces, plus and minus signs are allowed, and spaces will be converted to spaces.

L: Must enter letters (A-Z).

?: You can choose to enter letters (A-Z). You can leave it blank or enter spaces.

A: Must enter letters or numbers.

a: You can choose to enter letters or numbers. You can leave it blank or enter spaces.

&: Any character or space must be entered.

C: You can choose to enter any character or space.

<: Convert all subsequent characters to lowercase.

>: Convert all subsequent characters to uppercase.

!: Makes the input mask display from right to left.

\(backslash): Make the following characters appear as literal characters.

Password: Any characters entered in the text box are saved literally, but appear as asterisks*.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What can be used to control the format of input data in a text box. 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