读书人

输入域字符数量展示

发布时间: 2012-09-17 12:06:51 作者: rapoo

输入域字符数量显示
onblur="checkLen('feedBack');"

//字数限制
function checkLen(check){
if(!isEmpty(document.IntegrationForm.feedBack.value)&&check=="feedBack"){

var feedBack = document.IntegrationForm.feedBack.value;
document.IntegrationForm.feedBack.value = feedBack.substring(0,200);
}
if(!isEmpty(document.IntegrationForm.comments.value)&&check=="comments"){

var comments = document.IntegrationForm.comments.value;
document.IntegrationForm.comments.value = comments.substring(0,200);
}
}

读书人网 >编程

热点推荐