Grazie per il suggerimento, ma posso integrare il tuo code in un controllo form già esistente, cioè questo?:Originariamente inviato da Xinod
ti posto uno spunto,
sappi che x un vecchio (e mai corretto) bug di mozilla la questione si complica
codice:<script type="text/javascript"> function minimo4(ffld){ if(ffld.value!=''){ var bksl=(ffld.value.indexOf("\\")>-1)?"\\":"\/"; var pfrom=ffld.value.lastIndexOf(bksl)+1; var pfor=ffld.value.indexOf(".")-pfrom; var fname=ffld.value.substr(pfrom,pfor); if(fname.length>4){ alert('il nome del file selezionato non è valido'); ffld.focus(); } } } </script> ... <input type="file" ... onchange="minimo4(this)" onblur="minimo4(this)" />
codice:<script language="JavaScript"> <!-- function submitIt(theform) { if (theform.fname.value == "") { alert("Atencion: falta tu nombre..."); theform.fname.focus(); return false; } if (theform.lname.value == "") { alert("Atencion: falta tu apellido..."); theform.lname.focus(); return false; } if (theform.Ciudad.value == "") { alert("Atencion: falta tu ciudad..."); theform.Ciudad.focus(); return false; } if (theform.Estado.value == "") { alert("Atencion: falta tu Estado..."); theform.Estado.focus(); return false; } if (theform.Profesion.value == "") { alert("Atencion: falta tu Profesion..."); theform.Profesion.focus(); return false; } if ((theform.Email.value =="")|| (theform.Email.value.indexOf("@") == -1) || (theform.Email.value.indexOf(".") == -1) || (theform.Email.value.length < 7)) { alert("Atencion: falta tu email..."); theform.Email.focus(); return false; } if (theform.file.value == "") { alert("Atencion: falta tu Curriculum..."); theform.file.focus(); return false; } } --> </script> <form method="POST" enctype="multipart/form-data" action="Insert.asp" onSubmit="return submitIt(this)">