jQuery Disable Button After Click

Today, We want to share with you jQuery Disable Button After Click.In this post we will show you how to prevent multiple clicks on submit button in jquery, hear for how to disable submit button after form submission in javascript we will give you demo and example for implement.In this post, we will learn about how to change a button from enable to disable after click with an example.

jQuery Disable Button After Click

There are the Following The simple About jQuery Disable Button After Click Full Information With Example and source code.

As I will cover this Post with live Working example to develop jquery disable button after click for 5 seconds, so the jquery prevent double clicks for this example is following below.

READ :  vue autocomplete text input example - vuejs-autocomplete textbox

jQuery – How to disabled submit button after clicked

$('#saveEmployee').attr("disabled", false);	
or
$('#saveEmployee').removeAttr("disabled");

$("#saveEmployee").attr("disabled", true);

<!DOCTYPE html>
<html lang="en">

<body>
<h1>jQuery - How to disabled submit button after clicked - infinityknow.com</h1>

<form id="productFtm" action="#" method="POST">
    <input type="submit" id="saveEmployee" value="Submit"></input>
</form>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<input type="button" value="Update Product" id="updateBtn"></input>

<script>
    $(document).ready(function () {

        $("#productFtm").submit(function (e) {

            //stop submitting the html form to see the disabled button effect
            e.preventDefault();

            //jquery disable the submit button
            $("#saveEmployee").attr("disabled", true);

            //jquery simple disable a normal button
            $("#updateBtn").attr("disabled", true);

            return true;

        });
    });
</script>

</body>
</html>

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery Disable Button After Click.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

READ :  PHP Laravel 6 Get base url Examples

Add a Comment

Your email address will not be published. Required fields are marked *