There are two ways to disable form submission in HTML, they are: 1. Add 2. Add For example: <input type="text" value="" readonly="readonly" /> <input type="text" value="" disabled="disabled" /> Both controls in the example are not editable. But they also have some differences! From the literal meaning, we can know that a control with the readonly attribute is "read-only", while a control with the disabled attribute is "disabled". So what is the difference between them? The user cannot modify the value of a read-only control (a control that uses the readonly attribute) with the mouse or keyboard, but the programmer can modify it with JavaScript. When the form is submitted, the name and value of the control will be submitted to the server, which means it is visible to the server. Disabled controls (controls with the disabled attribute) cannot be modified by users with the mouse and keyboard, and are also invisible to the server. That is, their names and values are not submitted to the server when the form is submitted. Of course, programmers can also use JavaScript to modify their values. This is their difference. After knowing the difference, we should know when to use which method, and we must not be blind! Summarize This is the end of this article about the difference between html form control disabled attributes readonly VS disabled. For more relevant html readonly disabled content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: Detailed explanation of JSON.parse and JSON.stringify usage
>>: Metadata Extraction Example Analysis of MySQL and Oracle
"What's wrong?" Unless you are accus...
1. Download and unzip to: /Users/xiechunping/Soft...
When I installed php56 with brew on mac , I encou...
Preface I have been summarizing my front-end know...
Note: The basic directory path for software insta...
<br />Hello everyone! It’s my honor to chat ...
Add table fields alter table table1 add transacto...
Table of contents What is the Apollo Configuratio...
CSS to achieve the image hovering mouse folding e...
Not only do different browsers behave differently...
The attributes of the <TD> tag are used to ...
GitHub has all kinds of magic tools. Today I foun...
To put it simply, the IP of the virtual machine u...
1. Configuration By default, the first two are no...
Table of contents Preface 1. Download a single fi...