From: court Date: Tue, 17 Aug 2010 15:04:43 +0000 (+0000) Subject: disabling the submit buttons for question and answers. X-Git-Tag: live~577 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/4b20a67ddb4ebea2c6e09d51ee48da5a856edef8?hp=9b59b6bb395208c913ce5ce19212dd5341cfa98a disabling the submit buttons for question and answers. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@557 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/templates/ask.html b/forum/skins/default/templates/ask.html index c17ea51..6be8f59 100644 --- a/forum/skins/default/templates/ask.html +++ b/forum/skins/default/templates/ask.html @@ -68,6 +68,13 @@ } window.addEventListener('beforeunload', beforeUnload, true); + function submitClicked() { + window.removeEventListener('beforeunload', beforeUnload, true); + $("input.submit").each(function() { + this.disabled=true; + }); + } + var related_questions_url = "{% url related_questions %}"; @@ -136,7 +143,7 @@ {% if not request.user.is_authenticated %} {% else %} - + {% endif %} diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index efc5f5e..a9a1706 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -59,7 +59,14 @@ } window.addEventListener('beforeunload', beforeUnload, true); - + function submitClicked() { + window.removeEventListener('beforeunload', beforeUnload, true); + $("input.submit").each(function() { + this.disabled=true; + }); + } + +