Clicking a disabled input or button
There is no way to capture a click on disabled elements. Your best bet is to react to a specific class
on the element.
HTML Markup:
<input type="button" class="disabled" value="click" />
JavaScript code:
$('input').click(function (event) {
if ($(this).hasClass('disabled')) {
alert('CLICKED, BUT DISABLED!!');
} else {
alert('Not disabled. =)');
}
});
You could then use CSS styling to simulate a disabled look:
.disabled
{
background-color: #DDD;
color: #999;
}
Here's a jsFiddle demonstrating its use.
Making the field readonly
can help, because the click event will be fired. Though be aware of the differences in behaviour.
<input type="button" value="click" readonly="readonly" />