Firefox, and perhaps other browsers, disable DOM events on form fields that are disabled. Any event that starts at the disabled form field is completely canceled and does not propagate up the DOM tree. Correct me if I'm wrong, but if you click on the disabled button, the source of the event is the disabled button and the click event is completely wiped out. The browser literally doesn't know the button got clicked, nor does it pass the click event on. It's as if you are clicking on a black hole on the web page.
Work around:
Style the date fields to look as if they are disabled.
Make a hidden "use_date" form field with a bit value to determine whether to use the date fields during processing.
Add new function to onClick of the date fields which will change the style class to appear enabled and set the "use_date" value to 1.
another way
Use readonly instead of disabled
For checkboxes at least, this makes them look disabled but behave normally (tested on Google Chrome). You'll have to catch the click and prevent the default action of the event as appropriate.
You could put a div around the submit button and attach a click function to that for when the submit button is disabled:
<div id="sub-div"><input type="submit"><div>
$('sub-div').click(function(event){
if (attr('submit-button', 'disabled') == 'true')
{
alert('Button Disabled')
}
});
This is just code from the top of my head, so it might not be exactly right. But you get the poin