}\r
window.addEventListener('beforeunload', beforeUnload, true);\r
\r
- </script>\r
+ function submitClicked() {\r
+ window.removeEventListener('beforeunload', beforeUnload, true);\r
+ $("input.submit").each(function() {\r
+ this.disabled=true;\r
+ });\r
+ }\r
+\r
+ </script>\r
<noscript>\r
<style>\r
.comment.not_top_scorer {\r
<div id="previewer" class="wmd-preview"></div> \r
</div>\r
<p><span class="form-error"></span></p>\r
- <input type="submit" \r
+ <input type="submit"\r
{% if user.is_anonymous %}\r
value="{% trans "Login/Signup to Post Your Answer" %}" \r
{% else %}\r
value="{% trans "Answer the question" %}" \r
{% endif %}\r
{% endif %}\r
- class="submit" style="float:left" onclick="window.removeEventListener('beforeunload', beforeUnload, true)" />\r
+ class="submit" style="float:left" onclick="submitClicked()" />\r
{% endif %}\r
</form>\r
</div>\r