diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index c212e7b9d..1fcbc6cab 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -1,23 +1,7 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %> \ No newline at end of file diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 8f5cb15cc..bb531b85c 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -49,7 +49,7 @@ $("#reorder_popu").removeClass("sortArrowActiveD"); add_class("reorder_time"); }); - document.getElementById('forum_name').onkeydown = function() + $('#forum_name').keypress( function(e) { var n = 0; var str = this.value; @@ -61,9 +61,16 @@ n += 1;//英文,不多说了 } } - if(n >= 160 && event.keyCode != 8) - event.returnValue = false; - } + if(n >= 160 && e.keyCode != 8) + if(document.all) + { + e.returnValue = false; + } + else + { + e.preventDefault(); + } + }) }); function check_and_submit(doc){ $("#error").html('').hide(); diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 6a980cc87..366291691 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -149,7 +149,7 @@