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

Zabbix monitors the process of Linux system services

Zabbix automatically discovers rules to monitor s...

vmware virtual machine ubuntu18.04 installation tutorial

Installation Steps 1. Create a virtual machine 2....

CSS sample code with search navigation bar

This article shows you how to use CSS to create a...

Win10 + Ubuntu 16.04 dual system perfect installation tutorial [detailed]

Be sure to remember to back up your data, it is p...

Use PS to create an xhtml+css website homepage in two minutes

There are too many articles about xhtml+css websi...

Vue implements various ideas for detecting sensitive word filtering components

Table of contents Written in front Requirements A...

Docker starts in Exited state

After docker run, the status is always Exited Sol...

Docker deploys Macvlan to achieve cross-host network communication

Basic concepts: Macvlan working principle: Macvla...

MySQL scheduled database backup operation example

This article describes the example of MySQL sched...

How to authorize all the contents of a folder to a certain user in Linux?

【Problem Analysis】 We can use the chown command. ...

Nginx reverse proxy forwards port 80 requests to 8080

Let's first understand a wave of concepts, wh...

Virtual Box tutorial diagram of duplicating virtual machines

After getting used to VM, switching to BOX is a l...

Tips for writing concise React components

Table of contents Avoid using the spread operator...

Ubuntu 18.04 installs mysql 5.7.23

I installed MySQL smoothly in Ubuntu 16.04 before...