diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index fb5e8f2ab..8e850b7ed 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -149,7 +149,18 @@ function cookieget(n) $("#textCount").text(49-$("#subject").val().length) } }) + $("#subject").keyup(function(){ + var curLength=$("#subject").val().length; + if(curLength>=50){ + var num=$("#subject").val().substr(0,49); + $("#subject").val(num); + } + else{ + $("#textCount").text(50-$("#subject").val().length) + } + }) }) +
diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index 5b06be7e6..6ba244d6d 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -121,7 +121,7 @@ $(document).ready(function(){ $("#subject").val(num); } else{ - $("#textCount").text(49-$("#subject").val().length); + $("#textCount").text(50-$("#subject").val().length); } }) }) \ No newline at end of file