diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index c2997ac25..6c9428af3 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -28,6 +28,7 @@
}
}
$(function() {
+ hideError();
$("#complex").click(function(){
$("#reorder_popu").removeClass("sortArrowActiveU");
$("#reorder_popu").removeClass("sortArrowActiveD");
@@ -71,10 +72,11 @@
e.preventDefault();
}
})
+
});
function check_and_submit(doc){
- $("#error").html('').hide();
- check_forum_name();
+ $("#error").html("").hide();
+// check_forum_name();
if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){
$("#error").html("名称不能为空").show();
return;
@@ -91,17 +93,20 @@
}
var check_pass = true;
function check_forum_name(){
+ $("#error").html("").hide();
check_pass = true;
name = $("textarea[name='forum[name]']").val().trim();
+ alert(name)
if( name != ""){
$.get(
'<%= check_forum_name_forums_path %>',
{"forum_name":encodeURIComponent(name)},
function(data){
-
+ alert(data)
if( data == 'true'){
$("#error").html("贴吧名称已经存在").show();
check_pass = false;
+ return false;
}
}
);