添加标签 要限制长度

This commit is contained in:
lizanle 2015-09-21 16:08:05 +08:00
parent e81d8f83a5
commit 27a4954612
1 changed files with 2 additions and 2 deletions

View File

@ -61,13 +61,13 @@
function addTag(){
if(<%=@forum.creator.id == User.current.id%>) {
if ($("input[name='addTag']").val().trim() != "" ) {
if($("input[name='addTag']").val().trim().length <= 20) {
if($("input[name='addTag']").val().trim().length <= 14) {
$.get(
'<%= add_forum_tag_forum_path(@forum)%>' + "?tag_str=" + $("input[name='addTag']").val(),
{}
);
}else{
alert("标签名字长度不能超过20个字符");
alert("标签名字长度不能超过14个字符");
}
}
}