Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/02/2002, 07:13
bet
 
Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 24 años
Puntos: 0
Re: Checkall para todos

Algo así te puede servir:

<pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Marcar Todos &lt;/title&gt;
&lt;script language=&quot;JavaScript&quot;&gt;
&lt;!--
function marcarTodos(){
if (document.forms[ 0 ].todos.checked){
for (i=0;i&lt;document.forms[ 0 ].length;i++){
if ((document.forms[0].elements[ i ].name) == &quot;clt&quot;){
document.forms[0].elements[ i ].checked = true;
}
}
}
else {
for (i=0;i&lt;document.forms[ 0 ].length;i++){
if ((document.forms[ 0 ].elements[ i ].name) == &quot;clt&quot;){
document.forms[ 0 ].elements[ i ].checked = false;
}
}
}
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body bgcolor=&quot;#FFFFFF&quot;&gt;
&lt;form method=post action=&quot;&quot;&gt;

Marcar todos &lt;input type=&quot;checkbox&quot; name=&quot;todos&quot; onClick=&quot;marcarTodos();&quot;&gt;&lt;br&gt;&l t;br&gt;
* &lt;input type=&quot;checkbox&quot; name=&quot;clt&quot;&gt; &lt;br&gt;
* &lt;input type=&quot;checkbox&quot; name=&quot;clt&quot;&gt; &lt;br&gt;
* &lt;input type=&quot;checkbox&quot; name=&quot;clt&quot;&gt; &lt;br&gt;
* &lt;input type=&quot;checkbox&quot; name=&quot;clt&quot;&gt; &lt;br&gt;
* &lt;input type=&quot;checkbox&quot; name=&quot;clt&quot;&gt; &lt;br&gt;
&lt;/form&gt;

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

Aclaración: donde dice [ 0 ] y [ i ], no te olvides de sacarle los espacios

<hr noshade size=1><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]