Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

When I try to write a comment in quick succession after another, I get the expected "you gotta wait 15 seconds" notification in orange.

That's fine; I can wait. Ish.

But the "Add Comment" button is also disabled, and it cannot be re-enabled; I have to copy my comment to the clipboard, refresh the entire page, then try again.


(This appears to be new since at most a couple of days ago.)

(Firefox 8.0.1, Windows 7)

share|improve this question
Ok, I'm seeing it now too. The button is disabled but you can still submit your comment by pressing enter. On FF 8.0 on Win7x64. – Jeff Mercado Jan 4 '12 at 1:37
@balpha: Ta duck :) – Lightness Races in Orbit Jan 5 '12 at 21:36
up vote 8 down vote accepted

This is another .attr() versus .prop() issue from the jQuery 1.7 upgrade.

The function used by StackExchange.helpers.enableSubmitButton() needs to be updated to toggle the disabled property, instead of setting the attribute:

$(i).find('input[type="submit"]').prop('disabled', h);

or (since there's probably never more than one submit button anyway):

$(i).find('input[type="submit"]')[0].disabled = h;
share|improve this answer
I'm beginning to see why jQuery wanted to start being explicit about the differences between attributes and properties. Unfortunately, "consistency" is not a word that comes to mind when looking through the implementations of prop and attr. In jQuery 1.5, .attr("disabled", "") comes down to elem.disabled = "", which does the right thing. In 1.7, anything that's not === false is considered true. That's what we get for being good citizens previously and using "" instead of false :( – balpha Jan 4 '12 at 10:34
Yeah, they unfortunately opened a rather large can of worms by originally conflating the two. Despite the upgrade-related problems its caused, I am at least happy that the 1.7 behaviour is now what's expected for modifying the attribute. – Tim Stone Jan 4 '12 at 10:50
Almost :) Had we used false in the first place, it would still be wrong, but work. – balpha Jan 4 '12 at 10:58
Well, I was willing to consider .attr('disabled', false) the same as .removeAttribute('disabled') :P – Tim Stone Jan 4 '12 at 11:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .