Search This Blog

Showing posts with label change value of button in jquery. Show all posts
Showing posts with label change value of button in jquery. Show all posts

Monday, 17 November 2014

How to check whether Submit Button is disabled in JQuery ?


 How to check whether Submit Button is disabled in JQuery ?
        if($('#submitButton').is(':disabled')){
        //Code to be executed
       }

How to Enable button in Jquery  ?
         $('#submitButton').attr("disabled", false);

How to Disable button in Jquery  ?
        $('#submitButton').attr("disabled", true);

How to change value of Submit button in Jquery  ?
        $('#submitButton').val('Please wait ... Processing');


 Code :

$('#submitButton').click(function() {
                    if($('#submitButton').is(':disabled'))
                     {

                        $('#submitButton').attr("disabled", false);
                        $('#submitButton').val('Submit');

                     }
                    else
                    {
                       $('#submitButton').attr("disabled", true);
                        $('#submitButton').val('Please wait ... Processing');

                     }