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
As more and more Docker images are used, there ne...
Share a beautiful input box animation style libra...
Overview This article will introduce the MVC arch...
1) Introduction to cache mechanism In the Linux s...
What is CSS# CSS (abbreviation of Cascading Style...
1. Setting up nginx virtual host With virtual hos...
Based on Vue The core idea of this function is ...
Table of contents need: drive: Ideas: accomplish:...
Normally, when you run a command in the terminal,...
Recently, I have been studying the MySQL database...
Table of contents background Understanding compos...
Download url-loader yarn add -D url-loader module...
If you want to insert 5 records into table1, the ...
Sometimes the theme of a project cannot satisfy e...
Preface mysqlslap is a diagnostic program designe...