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

Vue3 Documentation Quick Start

Table of contents 1. Setup 1. The first parameter...

Box-shadow and drop-shadow to achieve irregular projection example code

When we want to add a shadow to a rectangle or ot...

Three BOM objects in JavaScript

Table of contents 1. Location Object 1. URL 2. Pr...

Centos7 installation of FFmpeg audio/video tool simple document

ffmpeg is a very powerful audio and video process...

Detailed tutorial on installing Docker on CentOS 7.5

Introduction to Docker Docker is an open source c...

Problems with join queries and subqueries in MySQL

Table of contents Basic syntax for multi-table jo...

Explaining immutable values ​​in React

Table of contents What are immutable values? Why ...

How to set up Referer in Nginx to prevent image theft

If the server's images are hotlinked by other...

How to use Vue+ElementUI Tree

The use of Vue+ElementUI Tree is for your referen...

Practice of using SuperMap in Vue

Table of contents Preface Related Materials Vue p...

How to change the character set encoding to UTF8 in MySQL 5.5/5.6 under Linux

1. Log in to MySQL and use SHOW VARIABLES LIKE &#...