Difference between HTML ReadOnly and Enabled

Difference between HTML ReadOnly and Enabled
The TextBox with the ReadOnly attribute will be displayed as the following markup on the client: <input readonly = "readonly">

The TextBox with the Enabled attribute will be displayed as the following markup on the client: <input disabled="disabled">

Html server controls use a class derived from the HtmlControl base class (full class name System.Web.UI.HtmlControls), which only has the Disabled property.

According to W3C specifications: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12


Inputs set to disabled will have the following restrictions:

<1> Can accept focus <2> Will be skipped when using the tab key <3> May not be successful Inputs set to readonly will have the following restrictions:

<1> Can accept focus but cannot be modified <2> Use the tab key to navigate <3> May be successful Only successful form elements have valid data, which means they can be submitted. Disabled and readonly text input boxes can only be modified by scripts

<<:  WeChat applet date and time component (year, month, day, hour, and minute)

>>:  How to operate MySql database with gorm

Recommend

Detailed explanation of the execution process of JavaScript engine V8

Table of contents 1. V8 Source 2. V8 Service Targ...

Share some uncommon but useful JS techniques

Preface Programming languages ​​usually contain v...

Detailed explanation of location and rewrite usage in nginx

1. Summary of location usage Location can locate ...

Summary of three ways to create new elements

First: via text/HTML var txt1="<h1>Tex...

Example code for implementing a text marquee with CSS3

Background Here's what happened, Luzhu accide...

MySQL startup error InnoDB: Unable to lock/ibdata1 error

An error message appears when MySQL is started in...

Detailed explanation of pid and socket in MySQL

Table of contents 1. Introduction to pid-file 2.S...

Detailed steps for completely uninstalling MySQL 5.7

This article mainly summarizes various problems o...

MySQL 5.7.18 release installation guide (including bin file version)

The installation process is basically the same as...

Detailed explanation of MySQL slow queries

Query mysql operation information show status -- ...

Detailed explanation of using Docker to build externally accessible MySQL

Install MySQL 8.0 docker run -p 63306:3306 -e MYS...