ho provato anche io in una pagine nuova e funziona ma non capisco perchè in questapagina no :master:
questo è il form1codice:<SCRIPT language="Javascript1.2"> function check() { var x=document.form1.elements[0].value; var ext=x.length; document.form1.elements[1].value=250-ext; if(parseInt(document.form1.elements[1].value)<0) { document.form1.elements[1].value="Err"; window.alert("Puoi scrivere al massimo 250 caratteri!!!"); var shorter=x.slice(0,250); document.form1.elements[0].value=shorter; document.form1.elements[1].value="0"; } } </SCRIPT>
codice:<form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="form1"> <table align="center"> <tr valign="middle"> <td align="right" nowrap class="Stile7"><span class="Stile7">Nome:</span></td> <td><div align="left"> <input name="nome" type="text" value="" size="50" tabindex="1"> </div></td> </tr> <tr valign="middle"> <td align="right" nowrap class="Stile7"><span class="Stile7">Descrizione:</span></td> <td><div align="left"> <textarea name="descrizione" id="descrizione" onkeyup="check()"></textarea> </div></td> </tr> <tr valign="middle"> <td align="right" nowrap class="Stile7"><span class="Stile7">Peso:</span></td> <td><div align="left"> <input name="peso" type="text" value="" size="10"> <span class="Stile7">espresso in KB </span></div></td> </tr> <tr valign="middle"> <td align="right" nowrap class="Stile7">Collegamento</td> <td><div align="left"> <input name="url" type="text" id="url" value="http://www.miosito.it" size="50"> </div></td> </tr> <tr valign="middle"> <td align="right" nowrap class="Stile7"><INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1024000"> Miniatura </td> <td> <div align="left"> <input name="UploadedFile" type="file" onChange="document.form1('miniatura').value=this.value.substr(this.value.lastIndexOf('\\')+1)" size="50"> </div></td> </tr> <tr valign="middle"> <td align="right" nowrap class="Stile7"><INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1024000"> Ingrandimento</td> <td><div align="left"> <input name="UploadedFileing" type="file" onChange="document.form1('ingrandimento').value=this.value.substr(this.value.lastIndexOf('\\')+1)" size="50"> </div> </tr> <tr valign="middle"> <td colspan="2" align="right" nowrap class="Stile7"></td> </tr> <tr valign="middle"> <td colspan="2" align="right" nowrap class="Stile7"> <div align="center"><span class="Stile7"> <input name="miniatura" type="hidden" id="miniatura"> <input name="ingrandimento" type="hidden" id="ingrandimento"> </span> <input name="datains" type="hidden" id="datains" value="<?php echo date('Y-m-j') ?>"> <input type="submit" value="Inserisci"> </div></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form>

Rispondi quotando