Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/01/2002, 18:37
bet
 
Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 23 años, 3 meses
Puntos: 0
Re: Validar campo type=file

Esto es lo que estás necesitando?

<pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt; New Document &lt;/title&gt;

&lt;script LANGUAGE=&quot;JavaScript&quot;&gt;
function archivos() {
var error = true;
for (i=0;i &lt;f1.userfile.length;i++){
if(f1.userfile.value ==&quot;&quot;){
i++;
alert(&quot;incompleto &quot; + i);
error = false;
break;
}
}

return error;
}
&lt;/script&gt;


&lt;/head&gt;

&lt;body bgcolor=&quot;#FFFFFF&quot;&gt;

&lt;form method=&quot;post&quot; name=&quot;f1&quot; action=&quot;cgi-bin/tu-script.cgi&quot;
enctype=&quot;multipart/form-data&quot; onSubmit=&quot;return archivos();&quot;&gt;
&lt;p&gt;&lt;input type=&quot;file&quot; name=&quot;userfile&quot;&gt;
&lt;p&gt;&lt;input type=&quot;file&quot; name=&quot;userfile&quot;&gt;
&lt;p&gt;&lt;input type=&quot;file&quot; name=&quot;userfile&quot;&gt;
&lt;p&gt;&lt;input type=&quot;file&quot; name=&quot;userfile&quot;&gt;
&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Enviar&quot; &gt; &lt;/p&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>


<hr noshade size=1 color="#000000"><img src="http://www.gograph.com/Images-8712/ClipArt/cat03.gif" height="50" border=0 align="absmiddle"> <font size="2" face="verdana" color="#000000">bet[/CODE]