Home > Web Front-end > JS Tutorial > Three ways to make the button gray and unavailable after clicking the submit button_javascript skills

Three ways to make the button gray and unavailable after clicking the submit button_javascript skills

WBOY
Release: 2016-05-16 17:22:25
Original
5986 people have browsed it

The first method: directly add

to the button

When you click submit, the submit button turns gray and becomes unavailable, which can effectively prevent repeated submissions. This code implements such a function. As can be seen from the code, we only need to add this sentence to the submit button: onclick="javascript:{this.disabled=true;document.form1.submit();}", which means that when the button is clicked, the button The unavailable attribute is set to true, so that the button becomes gray

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template