Home  >  Article  >  Backend Development  >  Attributes of input in PHP

Attributes of input in PHP

小云云
小云云Original
2018-01-26 13:49:1111080browse

This article mainly introduces the hidden, read-only and restricted attributes of input. By changing the attributes of input, the input box can be limited in length and cannot be modified. Friends in need can refer to it. I hope it can help everyone.

Hide

10a0c4c6fe334f1dd2642c4aa224944a

Readonly

36083b1ab81036845ce56f354dfd93cd

Invalid

&lt ;input type="text" disabled>

Limitations

##9bd912d309623976fc4e57530a5f892f

ENTER key moves the cursor to the next input box


<input onkeydown="if(event.keyCode==13)event.keyCode=9">

Shield input method


<input type="text" name="url" style="ime-mode:disabled" onkeydown="if(event.keyCode==13)event.keyCode=9">

There are two ways to achieve the read-only effect of input:

disabled and readonly.

Of course the two effects can only be read but not edited, but they are very different.

Disabled indicates that the input is invalid and its value will not be passed to any program, such as asp, PHP, etc.

Readonly only cannot be edited and does not affect the transfer of its value.

Disabled use:



<INPUT type=”text” name=”username” value=”james” disabled> 
Readonly使用: 
<INPUT type=”text” name=”partNumber” value=”1500″ readonly>

Related recommendations:


Detailed explanation of WeChat applet input input examples

Tutorial on how to encapsulate input components in Vue

php://input input stream detailed explanation


The above is the detailed content of Attributes of input in PHP. 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