动态计算还能够输入多少字节的表单代码^O^(申请入精华)

发表于:2007-06-30来源:作者:点击数: 标签:
<textarea name="icqcontent" cols="40" onKeyDown="textCounter(this);" onKeyUp="textCounter(this);" rows="5"><%=request.form("subject")%></textarea>
<font color=#FF9933>*</font>(<span id="hints"><%=ann_Youcaninput & " " & 100-len(request.form("subject")) & " " & ann_byte%></span>)
<script language="javascript">
function textCounter(field) {
var l=field.value.length;
if (field.value.length > 100)
field.value = field.value.substring(0, 100);
else
document.all("hints").innerText="<%=ann_Youcaninput%> "+(100-l)+" <%=ann_byte%>"
}
</script>

原文转自:http://www.ltesting.net