sehummel
sehummel

Reputation: 5568

jQuery bug in Chrome with form submission disabling

Here is my code:

$('#continue').click(function() {
   $('input[type=submit]', this).attr('disabled', 'disabled');
});

This disables the submit button and it works in Firefox and IE. But it doesn't work in Chrome or most likely Safari.

EDIT: I want the button reenabled when a particular link is clicked. I have this:

$("#continue").removeAttr("disabled");

but it doesn't work in Chrome.

Upvotes: 1

Views: 1070

Answers (2)

mattsven
mattsven

Reputation: 23263

It works fine for me: http://jsfiddle.net/YEZS7/

Upvotes: 1

stlvc
stlvc

Reputation: 823

Do you want to disable the submit button if the user clicks on another element, or is #continue the submit button? Because in this case, you just need to return false in your click-function.

$('#continue').click(function() {
   return false;
});

Upvotes: 0

Related Questions