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

Attributes of input in PHP

小云云
Release: 2023-03-19 17:02:01
Original
11106 people have browsed it

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

<input type="hidden">

Readonly

<input type="text" readonly>

Invalid

&lt ;input type="text" disabled>

Limitations

##

ENTER key moves the cursor to the next input box


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

Shield input method


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

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template