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
I took the bus to work a few days ago. Based on m...
Shell is a program written in C language, which i...
Table of contents 0. What is Webpack 1. Use of We...
This article compares and summarizes four ways of...
> Deploy MySQL 5.7 cluster master & slave ...
max_allowed_packet is a parameter in MySQL that i...
<base target=_blank> changes the target fram...
Table of contents Overview Index data structure B...
The MySQL explain command can analyze the perform...
Preface smb is the name of a protocol that can be...
1. Install and start nginx # Install nginx sudo a...
In this article, we will analyze the production of...
Table of contents Overview Subqueries Subquery Cl...
Background: I'm working on asset reporting re...
Table of contents 1. How to create an array in Ja...