I notice that about two weeks ago your site changed subtly, Dave. Before, I’d click on “POST” to submit a comment and then wait and wait while it processed. Now it’s still as slow (sorry!) but as soon as I click on that POST button it grays out so I can’t click on it again. Cool. How do you do that?
First off, I know, I know, the site runs slow and we are planning our annual migration to a faster server. Now we’re serving up almost two million pages/month to over a million unique visitors and, well, that’s a lotta traffic! So have just a bit of patience when you’re adding your comments, please.
On this particular blog, I’m running Movable Type, but the way I auto-disable the submit button turns out to be generic and I found it from a recommendation on the Movable Type ProNet list. The specific solution I am using came from Solid Wall of Code blog.
In the “Individual Entry” archive template, the bottom of the comment form looks like this:
<input style=”font-weight: bold;” type=”submit” name=”post” value=” Post (please only click once!) ” />
You click on that and if the server doesn’t immediately return a results page, you can sit on that spot and click it again and again, doing who knows what to the data channel.
Instead, here’s the code I have now:
<input type=”submit” name=”post_comment” id=”post_comment” value=” Post
(please only click once) “
document.comments_form.mode.name = ‘post’;
This is a general HTML solution, by the way, even though what I’m showing is specific to a Movable Type weblog comment template. You could use this to have an automatically disabled submit form on any HTML page or site you’re building, complicated or simple.
My thanks to Leo Notenboom of Ask Leo for his initial suggestion of this solution to my duplicate comment problem.