-1

I would like to perform the click event of a element:

jQuery('input#submit').click(function() {

    if ( jQuery('input#submit').attr("disabled") ) {    
        alert('SUP');
    }

});

However this will not work as the element is required to be enabled for the click even to be executed.

Any help would be appreciated,

Thanks

1 Answers1

0

Why would you want the click event to work for the disabled button? Your best bet would be to keep the button enabled, but only have it 'work' if some other condition is met, by preventing the button from causing a submit by returning false. E.g.:

jQuery('input#submit').click(function(e) {
        if ( something ) {        
            return false;
        } 
});
karim79
  • 339,989
  • 67
  • 413
  • 406