News:

To still receiving newsletters from us please subscribe to our Newsletters:
http://tech.groups.yahoo.com/group/developers-Heaven/

Main Menu

jQuery: How to check if button is disabled

Started by admin, October 19, 2011, 04:47:47 PM

Previous topic - Next topic

admin

jQuery: How to check if button is disabled

You can use jQuery to trigger a button click from the client.  In this certain situation, I needed to make sure the button was not disabled prior to clicking.  In jQuery you can use the "is" function to check if the button is disabled like this:

<script type="text/javascript">
    $(document).ready(function() {
    if ($('#StartButton').is(':disabled') == false) {
            $('#StartButton').click();
        }
    });
</script>