From: qw3rty Date: Fri, 11 Jun 2010 18:22:53 +0000 (+0000) Subject: OSQA-313 X-Git-Tag: live~723 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/17b2ea541c2ed1aa4edb28cc7b23c08510fab736 OSQA-313 users can no longer add repeating spaces to get around the minimum comment length. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@409 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index c78367b..8326eb0 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -390,7 +390,7 @@ $(function() { cleanup_form(); function process_form_changes() { - var length = $textarea.val().length; + var length = $textarea.val().replace(/[ ]{2,}/g," ").length; if (current_length == length) return; @@ -406,6 +406,7 @@ $(function() { $chars_togo_message.show(); $chars_counter.html(min_length - length); } else { + length = $textarea.val().length; $chars_togo_message.hide(); $chars_left_message.show(); $chars_counter.html(max_length - length);