A brief discussion on read-only and disabled attributes in forms

A brief discussion on read-only and disabled attributes in forms

Read-only and disabled attributes in forms

1. Read-only: The server does not want users to modify the data, but only requires the data to be displayed in the form. For example, registration or transaction agreements, product prices, etc.

2. Disable: A function can only be used after a certain condition is met. For example, users are allowed to click the "Register" button only after they agree to the registration agreement. The player space can no longer click the "Play" button when it is in playback state.

Read-only Implemented through the readonly attribute
Disable Implemented through the disabled attribute

For example

<textarea name=”text” rows=”10” cols=”30” readonly=”readonly”><!—This document attribute is read-only-->

(Specific content of the service agreement)…</textarea>

<input type=”submit” value=”Register” disabled=”disabled“/><!—This button is disabled-->

Extension: <input type=”submit” name=”button” value=”Agree to the terms of service, submit registration button” disabled=”true”/>

The above brief discussion on the read-only and disabled attributes in the form is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

<<:  Conditional comments to determine the browser (IE series)

>>:  Let's talk about the LIMIT statement in MySQL in detail

Recommend

How to implement multiple parameters in el-dropdown in ElementUI

Recently, due to the increase in buttons in the b...

mysql: [ERROR] unknown option '--skip-grant-tables'

MySQL database reports ERROR 1045 (28000): Access...

JavaScript Regular Expressions Explained

Table of contents 1. Regular expression creation ...

MySQL 8.0 New Features - Introduction to Check Constraints

Table of contents Preface Check Constraints Creat...

MySQL trigger principle and usage example analysis

This article uses examples to explain the princip...

vue-electron problem solution when using serialport

The error is as follows: Uncaught TypeError: Cann...

Difference between querySelector and getElementById methods in JS

Table of contents 1. Overview 1.1 Usage of queryS...

A performance bug about MySQL partition tables

Table of contents 2. Stack analysis using pt-pmap...

Vue implements the shake function (compatible with ios13.3 and above)

Recently, I made a function similar to shake, usi...

centos 7 modify sshd | prohibit root login and sshd port script definition

1. Create a new user wwweee000 [root@localhost ~]...

Comparison of the advantages of vue3 and vue2

Table of contents Advantage 1: Optimization of di...

How to quickly build your own server detailed tutorial (Java environment)

1. Purchase of Server 1. I chose Alibaba Cloud...

Example of using Nginx to implement port forwarding TCP proxy

Table of contents Demand Background Why use Nginx...

Detailed tutorial for installing mysql 8.0.12 under Windows

This article shares with you a detailed tutorial ...