Fix for Typo Scribbish theme v2 - aka disabling a submit button in IE 2
I looked into it a little more this morning, and came up with how to still get the submit button disabling, to avoid double-posts, without having to rework anything substantially.
<%= submit_tag 'Submit', :onclick => "$('commentform').onsubmit();this.disabled=true;Element.hide('preview');return false;"%>
You first call the form’s onsubmit, since IE won’t call it if you submit the form via JavaScript, then you prevent browsers that don’t cancel the form when you disable the submit button from double-submitting, by returning false at the end.
This should still work with javascript off, if you have the “Allow non-Ajax comments” setting turned on.
Comments not working in Typo Scribbish theme 5
<%= submit_tag 'Submit', :onclick => "this.disabled=true; Element.hide('preview');" %>
The “this.disable=true” disables the submit button before the form is submitted, so all that happens is the onclick. For now I am just taking that out of mine – I’ll look at a better fix later.

Articles via rss or email