Set the input to read-only via disabled and readonly

Set the input to read-only via disabled and readonly
There are two ways to achieve read-only input: disabled and readonly.

Naturally, both results can only be read but not edited, but there are big differences between the two.

Disabled means that the input is invalid and its value will not be passed to any program, such as asp, php, etc.
Readonly simply cannot be edited and does not affect the transmission of its value.

Disabled usage: <INPUT type="text" name="username" value="james" disabled>
Readonly usage: <INPUT type="text" name="partNumber" value="1500" readonly>

<<:  A brief discussion on whether too many MySQL data queries will cause OOM

>>:  How to distribute two buttons on the left and right sides of the same parent tag using CSS

Recommend

Solution to MySql service disappearance for unknown reasons

Solution to MySql service disappearance for unkno...

How to insert video into HTML and make it compatible with all browsers

There are two most commonly used methods to insert...

VMware Workstation Pro installs Win10 pure version operating system

This article describes the steps to install the p...

Using streaming queries in MySQL to avoid data OOM

Table of contents 1. Introduction 2. JDBC impleme...

Basic learning and experience sharing of MySQL transactions

A transaction is a logical group of operations. E...

JavaScript Regular Expressions Explained

Table of contents 1. Regular expression creation ...

In-depth explanation of the style feature in Vue3 single-file components

Table of contents style scoped style module State...

HTML multimedia application: inserting flash animation and music into web pages

1. Application of multimedia in HTML_falsh animat...

Simple example of limit parameter of mysql paging

Two parameters of Mysql paging select * from user...

HTML scroll bar textarea attribute setting

1. Overflow content overflow settings (set whether...

Example of using docker compose to build a consul cluster environment

Basic concepts of consul Server mode and client m...