 
			
				25/08/2008, 11:40
			
			
			     |  
      |    |    |    Fecha de Ingreso: abril-2008  
						Mensajes: 151
					  Antigüedad: 17 años, 6 meses Puntos: 0     |        |  
  |      Respuesta: Recorrer tabla        <div id = "tabla1" style="width: 900px; height:420px; background-color: white; border-bottom : 1px solid #cccccc; border-left : 1px solid #cccccc ; border-widht:4px; overflow:auto;">   
         <center><h1 style = "color: blue">Solicitud de Utiles</center> 
      <center><h1 style = "color: blue">Departamento de:ADMINISTRACION</center> 
      <center><h1 style = "color: blue">Fecha de Pedido:25/08/08</center> 
      <body onload="pinta()"> 
      <form name = formulario action = adicionapedido.php method = get><TABLE BORDER = 10 id = tabla><TR><TH bgcolor=#C0D9D9>Fecha</th><TH bgcolor=#C0D9D9>Categoria</th><TH bgcolor=#C0D9D9>Cod</th><TH bgcolor=#C0D9D9>Descripcion</th><TH bgcolor=#C0D9D9>Unidad</th><TH bgcolor=#C0D9D9>Cantidad</th><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>123</td><td>Lápices Mongol</td><td id="unidad"><input type="text" name="und" id="und"></td>   
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>124</td><td>Lápiz Mecánico 0.5 / 0.7</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>125</td><td>Liquido corrector Pentel blanco</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>126</td><td>Marcadores permanentes N 60 Verde</td><td id="unidad"><input type="text" name="und" id="und"></td>   
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>127</td><td>Repuesto Borrador Mecànico</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>128</td><td>Marcadores permanentes N 60 Negro</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>129</td><td>Minas  2B 0.5</td><td id="unidad"><input type="text" name="und" id="und"></td>   
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>130</td><td>Minas  2B 0.7</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>131</td><td>Pluma Uni-ball 0.8</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>132</td><td>Plumas Azul</td><td id="unidad"><input type="text" name="und" id="und"></td>   
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>133</td><td>Plumas Negra</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>134</td><td>Plumas Roja</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>135</td><td>Repuesto Pentel BK 77 colores variados</td><td id="unidad"><input type="text" name="und" id="und"></td>   
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>136</td><td>Resaltadores  colores variados</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>137</td><td>Marcadores de Agua BIC</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>BOLIGRAFO-LAPIZ</td><td>138</td><td>Borrador Tablero</td><td id="unidad"><input type="text" name="und" id="und"></td>   
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>PAPELERIA</td><td>139</td><td>Etifold</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>PAPELERIA</td><td>140</td><td>banderita adhesivas</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>PAPELERIA</td><td>141</td><td>Pendaflex legales</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr><tr><td>25/08/08</td><td>OTROS/VARIOS</td><td>304</td><td>Vale Provisional</td><td id="unidad"><input type="text" name="und" id="und"></td> 
         <td id="cantidad"><input type="text" name="cant" id="cant"></td> </tr></table></form></body> 
         </div> 
   <div float:bottom> 
      <input type="button" name="adicionapedido" value="Realizar Pedido"> 
      <input value="Ver valores de la tabla" onclick="datosTextos()" type="button" />   
   </div> 
               <div id="pie"> 
                 AviIntranet© 2007 Desarrollado 
            </div> 
          </div> 
       </div> 
   </body>   
<script language="javascript"> 
function pinta() 
{ 
   cual=document.getElementById("tabla").rows; 
   for(a=0;a<cual.length;a++) 
   { 
      color(a); 
   } 
} 
function color(b) 
{ 
   if(b%2==0) 
      cual[b].style.backgroundColor="#9999FF"; 
   else 
      cual[b].style.backgroundColor="white"; 
} 
</script>   
<script> 
function datosTextos() 
largo = document.formulario.und.length; 
und = document.formulario.und;//array con todos los und 
cant = document.formulario.cant;//array con todos los cant   
for(i=0;i<largo;i++) 
{ 
   alert(und[i]+" "+cant[i]);//un alert por fila.... 
} 
</script>           |