修改允许输入的简介长度

This commit is contained in:
Li Jianxuan 2012-12-13 08:36:14 +00:00
parent 918697085d
commit 486326e87e
3 changed files with 9 additions and 9 deletions

View File

@ -386,7 +386,7 @@ class Admin_NewsController extends Zend_Controller_Action
if(empty($title)) $msg[]="标题不能为空"; if(empty($title)) $msg[]="标题不能为空";
if(mb_strlen($title)>200) $msg[]="标题长度不能超过200个字符"; if(mb_strlen($title)>200) $msg[]="标题长度不能超过200个字符";
if(mb_strlen($keyword)>200) $msg[] = "关键词长度不能超过200个字符现在输入了".strlen($keyword)."个字符"; if(mb_strlen($keyword)>200) $msg[] = "关键词长度不能超过200个字符现在输入了".strlen($keyword)."个字符";
if(mb_strlen($description)>400) $msg[] = "内容描述不能超过200个字符现在输入了".strlen($description)."个字符"; if(mb_strlen($description)>1000) $msg[] = "内容描述不能超过1000个字符现在输入了".strlen($description)."个字符";
if(empty($body)) $msg[]="请填写内容"; if(empty($body)) $msg[]="请填写内容";
if(empty($typeid)) $msg[]="请选择栏目"; if(empty($typeid)) $msg[]="请选择栏目";
if(!is_array($typeid) || count($typeid)<1) if(!is_array($typeid) || count($typeid)<1)

View File

@ -198,18 +198,18 @@ function addon(){
}); });
} }
$('#description').val(''); $('#description').val('');
var limitNum = 200; var limitNum = 1000;
var pattern = '还可以输入' + limitNum + '字'; var pattern = '还可以输入' + limitNum + '';
$('#enablelen').html(pattern); $('#enablelen').html(pattern);
$('#description').keyup( $('#description').keyup(
function() { function() {
var remain = getByteLen($(this).val()); var remain = getByteLen($(this).val());
if (remain > limitNum) { if (remain > limitNum) {
var result = remain -limitNum; var result = remain -limitNum;
pattern = '字数超过限制,请适当删除部分内容(超出了'+result+'字)'; pattern = '字数超过限制,请适当删除部分内容(超出了'+result+')';
}else{ }else{
var result = limitNum - remain; var result = limitNum - remain;
pattern = '还可以输入' + result + '字'; pattern = '还可以输入' + result + '';
} }
$('#enablelen').html(pattern); $('#enablelen').html(pattern);
} }

View File

@ -228,18 +228,18 @@ function addon(){
} }
}); });
} }
var limitNum = 200; var limitNum = 1000;
var pattern = '还可以输入' + (limitNum-getByteLen($('#description').val())) + '字'; var pattern = '还可以输入' + (limitNum-getByteLen($('#description').val())) + '';
$('#enablelen').html(pattern); $('#enablelen').html(pattern);
$('#description').keyup( $('#description').keyup(
function() { function() {
var remain = getByteLen($(this).val()); var remain = getByteLen($(this).val());
if (remain > limitNum) { if (remain > limitNum) {
var result = remain -limitNum; var result = remain -limitNum;
pattern = '字数超过限制,请适当删除部分内容(超出了'+result+'字)'; pattern = '字数超过限制,请适当删除部分内容(超出了'+result+')';
}else{ }else{
var result = limitNum - remain; var result = limitNum - remain;
pattern = '还可以输入' + result + '字'; pattern = '还可以输入' + result + '';
} }
$('#enablelen').html(pattern); $('#enablelen').html(pattern);
} }