<Script Language="Javascript">
<!--
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
document.WRITEMSGTXT.remLen.value = maxlimit - field.value.length;
}
//-->
</script>
<table width=447 border=0 cellpadding=0 cellspacing=0 bgcolor=#eaffe0>
<form name=WRITEMSGTXT method="post" action='class_leaveword.jsp' onsubmit="return saveTXT()">
<tr>
<td width=50% colspan=3> <font color=46A718>快速留言</font></td>
<td align=right><font color=46A718>剩余字数:<input name=remLen value=500 readonly type=text size=4 maxlength=3 style="background-color: #eaffe0; border: 0; color: red"></font></td>
</tr>
</table>
<table width=447 border=0 cellpadding=0 cellspacing=0>
<input type=hidden name=add value=1>
<input type=hidden name=wordid value=0>
<input type=hidden name=msgtype value=1>
<input type=hidden name=met value="add">
<input type=hidden name=isedit value="">
<input type=hidden name=type value=0>
<input type=hidden name=classuuid value="2815032345959506028">
<input type=hidden name=tm value='1089875161888'>
<tr align=center>
<td colspan=3><textarea name=words cols=60 rows=3 class=input1 onPropertyChange="textCounter(WRITEMSGTXT.words, 500)"></textarea></td>
</tr>
<!--
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
document.WRITEMSGTXT.remLen.value = maxlimit - field.value.length;
}
//-->
</script>
<table width=447 border=0 cellpadding=0 cellspacing=0 bgcolor=#eaffe0>
<form name=WRITEMSGTXT method="post" action='class_leaveword.jsp' onsubmit="return saveTXT()">
<tr>
<td width=50% colspan=3> <font color=46A718>快速留言</font></td>
<td align=right><font color=46A718>剩余字数:<input name=remLen value=500 readonly type=text size=4 maxlength=3 style="background-color: #eaffe0; border: 0; color: red"></font></td>
</tr>
</table>
<table width=447 border=0 cellpadding=0 cellspacing=0>
<input type=hidden name=add value=1>
<input type=hidden name=wordid value=0>
<input type=hidden name=msgtype value=1>
<input type=hidden name=met value="add">
<input type=hidden name=isedit value="">
<input type=hidden name=type value=0>
<input type=hidden name=classuuid value="2815032345959506028">
<input type=hidden name=tm value='1089875161888'>
<tr align=center>
<td colspan=3><textarea name=words cols=60 rows=3 class=input1 onPropertyChange="textCounter(WRITEMSGTXT.words, 500)"></textarea></td>
</tr>
解决方案 »
- 定义Observer时,怎样向观察者传递一个标记?
- 程序运行后加载不上中文,求解了
- 求一段弹出消息的javascript代码
- 看不懂帮我解释一下 谢谢
- document.execCommand("UnSelect",false,null)火狐下为什么报错并不执行?
- 动态网页执行后可否保存为静态网页
- 请问如何改变一个控件在网页中的位置
- document.getElementById("LinkButton1").onclick=aa;javascript问题 高手 看看 (急)=
- 我为什么得不到,this.text 的值
- 看看这个有什么错误?应该怎么改?
- 怎们让下拉类表失效?
- window.location.reload() 的问题?(高分求解)
<Script Language="Javascript">
<!--
function showLength() {
var oWord = document.all.stefli_word;
var oContent = document.all.stefli_content;
var iMax = 500;
if(oContent.value.length>iMax) {
oContent.value = oContent.value.substring(0,iMax);
} else {
oWord.value = iMax - oContent.value.length
}
}
//-->
</script>
<form name="stefli_form" method="post" action="">
<table width="433" border="0" cellpadding="1" cellspacing="0" bgcolor="#eaffe0">
<tr>
<td width="433">剩余字数:
<input name="stefli_word" type="text" id="stefli_word" size="4" maxlength="4" value="500"></td>
</tr>
<tr>
<td><textarea name="stefli_content" cols="60" rows="4" id="stefli_content" onPropertyChange="showLength();"></textarea></td>
</tr>
</table>
</form>