oldvalue1=0;oldvalue2=0;oldvalue3=0;functiontextCounterMulti(cnt"> oldvalue1=0;oldvalue2=0;oldvalue3=0;functiontextCounterMulti(cnt" />
欢迎来到天天文库
浏览记录
ID:57700659
大小:43.50 KB
页数:10页
时间:2020-09-01
《多文档字数限制.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、多文本框字数统计和限制把如下代码加入
2、lue.length+field3.value.length);varactual_length=(field1.value.length+field2.value.length+field3.value.length);vartotalstring=(field1.value+field2.value+field3.value);lt='1';opencount=0;opos=totalstring.indexOf("<");while(opos!=-1){opencount++;ltposition[lt]=totalstring.indexOf("<",
3、opos);opos=totalstring.indexOf("<",opos+1);total_length=ltposition[lt];lt++}gt='1'closecount=0;cpos=totalstring.indexOf(">");while(cpos!=-1){closecount++;gtposition[gt]=totalstring.indexOf(">",cpos);cpos=totalstring.indexOf(">",cpos+1);gt++}for(tt=1;tt<=opencount;tt++){//alert(gtpos
4、ition[tt]+"isthepositionofcloser#"+tt);if(closecount==opencount){//alert(tt);tagtext[tt]=((gtposition[tt]+1)-(ltposition[tt]))//alert(tagtext[tt])if(tt>1){tagtext[tt]=(tagtext[tt-1]+tagtext[tt])//alert(tagtext[tt])document.headermaker.textintags.value=tagtext[tt];}}}total_length=(ac
5、tual_length-tagtext[opencount]);if((closecount=='0')&(opencount!='0')){total_length=actual_length-(actual_length-ltposition[opencount]);}if((closecount6、l_length-tagtext[insideopencount]((actual_length-ltposition[opencount]));}if((closecount=='0')&(opencount=='0')){total_length=actual_length;}//alert(actual_length-(actual_length-ltposition[opencount]))varmaxvalue1=((toplimit)-((field2.value.length)+(field3.value.length))+(tagtext[op7、encount]));varmaxvalue2=((toplimit)-((field1.value.length)+(field3.value.length))+(tagtext[opencount]));varmaxvalue3=((toplimit)-((field1.value.length)+(field2.value.length))+(tagtext[opencount]));//alert(field3.value.length+","+toplimit)if((field1.value.length>maxvalue1)&(toplimit!8、='0')&(oldvalue1!=f
6、l_length-tagtext[insideopencount]((actual_length-ltposition[opencount]));}if((closecount=='0')&(opencount=='0')){total_length=actual_length;}//alert(actual_length-(actual_length-ltposition[opencount]))varmaxvalue1=((toplimit)-((field2.value.length)+(field3.value.length))+(tagtext[op
7、encount]));varmaxvalue2=((toplimit)-((field1.value.length)+(field3.value.length))+(tagtext[opencount]));varmaxvalue3=((toplimit)-((field1.value.length)+(field2.value.length))+(tagtext[opencount]));//alert(field3.value.length+","+toplimit)if((field1.value.length>maxvalue1)&(toplimit!
8、='0')&(oldvalue1!=f
此文档下载收益归作者所有