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

MySQL users and permissions and examples of how to crack the root password

MySQL Users and Privileges In MySQL, there is a d...

Several commonly used single-page application website sharing

CSS3Please Take a look at this website yourself, ...

SQL injection vulnerability process example and solution

Code example: public class JDBCDemo3 { public sta...

Detailed explanation of flex layout in CSS

Flex layout is also called elastic layout. Any co...

Teach you how to make cool barcode effects

statement : This article teaches you how to imple...

Docker data volume common operation code examples

If the developer uses Dockerfile to build the ima...

How to solve the front-end cross-domain problem using Nginx proxy

Preface Nginx (pronounced "engine X") i...

JavaScript Design Pattern Command Pattern

The command pattern is a behavioral design patter...

Pure CSS implementation of radio and checkbox effect example

radio-and-checkbox Pure CSS to achieve radio and ...

How to change the password of mysql5.7.20 under linux CentOS 7.4

After MySQL was upgraded to version 5.7, its secu...