Naga Botak
Naga Botak

Reputation: 751

Add Disable Button On Submit In My JS

How to include the JS disable button ON SUBMIT in below my code :

$(document).ready(function(){

        $('#haps').bind("blur focus keydown keypress keyup", function(){recount();});
        $('input.button').attr('disabled','disabled');

        $('#hapsForm').submit(function(e){

            haps();

        });

    });

This I give the function to prevent double post. So have an idea ?

Thank you

Upvotes: 0

Views: 60

Answers (1)

NullPoiиteя
NullPoiиteя

Reputation: 57312

you can dot this by

attr('disabled', 'disabled');

like

 $('#hapsForm').submit(function(e){
  $(this).attr('disabled', 'disabled');
            haps();

        });

Upvotes: 1

Related Questions