动态计算还能够输入多少字节的表单代码
<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>
<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>
- 没有相关文章
- 没有评论