![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
function checkcount(filed,fieldcount,maxlength)
{
if(filed.value.length>maxlength)
{
filed.value=filed.value.substring(0,maxlength);
}
else
{
fieldcount.style.cssText="color:#ffffff;background-color:#3c66a6;font-size:9pt";
//fieldcount.style.width=filed.value.length+"px";
fieldcount.innerHTML="當前字限";
fieldcount.innerHTML+=maxlength;
fieldcount.innerHTML+=" 已經輸入 [";
fieldcount.innerHTML+="<font style='color:red'>"+filed.value.length+"</font>]";
fieldcount.innerHTML+=" 還可以輸入 ";
fieldcount.innerHTML+="[<font style='color:#BCF74E'>"+(maxlength-filed.value.length)+"</font>]";
fieldcount.innerHTML+=" 個字符";
}
}
function ShowToolTip(objValue)
{
var div=document.createElement("div");
div.id="showTool";
$("operate").appendChild(div);
div.style.cssText="display:block;background-color:infobackground;font-size:9pt;color:#5d00e7;border:solid 1px indianred;overflow:visible;position:absolute;Z-INDEX:2001;filter: alpha(opacity=85);";
div.innerHTML="提示信息:輸入數量请不要大于"+objValue+"!";
x = event.clientX + document.body.scrollLeft;////获取鼠标位置
y = event.clientY + document.body.scrollTop + 20;//#DF7417
div.style.left=x;
div.style.top=y;
}
function hiddentooltip()
{
var obj=$("operate").childNodes;
for(var i=0;i<obj.length;i++)
{
if(obj[i].id=="showTool")
{
$("operate").removeChild(obj[i]);
}
}
}