MaxRom | Scripturi uCoz Romania

Bannerul tau aici
[ Mesaje noi · Membrii · Regulamentul forumului · RSS ]
  • Pagina 1 din 1
  • 1
Verificaţi limita de caractere in post pe forum
Devil Date: Joi, 2011-06-30, 18:27 | Message # 1
Mesaje: 425
Awards: 15
« 29 »

Instalare :

1)
CP ---> Design ---> Design management (templates) ---> Forum ---> New Message Form si schimbam

Code
$ _MESSAGE $


cu :

Code
<div onKeyUp="chklen()">$_MESSAGE$</div><div class="BGcount"><div style="float:left;padding-top:4px;">Caractere ramase:</div><div align="right" style="padding:2px;"><input name="fcounter" type="text" class="codeButtons" size="6" value="40000" readonly="true"></div></div>


2)
CP ---> Design ---> Design management (templates) ---> Forum ---> General appearance of forum pages ---> jos de tot adaugati :

Code
<script type="text/javascript">
   function chklen() {
   max_limit=40000;
      
   str = document.addform.message.value;
   len = str.length;
      
   if (len > max_limit) {
   str = str.substring(0,max_limit);
   len = str.length;
   document.addform.message.value = str;}
      
   document.addform.fcounter.value = (max_limit - document.addform.message.value.length);
      
   while ( document.addform.fcounter.value<0) {
   document.addform.message.value = str.substring(0,len-1);
   str = document.addform.message.value;
   len = str.length;
   document.addform.fcounter.value = (max_limit - document.addform.message.value.length);}}
   </script>


Sursa : Link

Rezultat :

 
  • Pagina 1 din 1
  • 1
Căutare: