Fix for Typo Scribbish theme v2 - aka disabling a submit button in IE 2

Posted by Tim Connor Thu, 26 Oct 2006 17:11:00 GMT

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

Posted by Tim Connor Thu, 26 Oct 2006 02:22:00 GMT

For those who may have noticed that your Typo blog won’t allow comments from IE users (is that a feature, or what?), I found the problem.

<%= 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.