From 4b20a67ddb4ebea2c6e09d51ee48da5a856edef8 Mon Sep 17 00:00:00 2001 From: court Date: Tue, 17 Aug 2010 15:04:43 +0000 Subject: [PATCH] disabling the submit buttons for question and answers. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@557 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/skins/default/templates/ask.html | 9 ++++++++- forum/skins/default/templates/question.html | 13 ++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) 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; + }); + } + +