Ver Mensaje Individual
  #9 (permalink)  
Antiguo 09/01/2007, 09:58
Avatar de derkenuke
derkenuke
Colaborador
 
Fecha de Ingreso: octubre-2003
Ubicación: self.location.href
Mensajes: 2.665
Antigüedad: 21 años, 4 meses
Puntos: 45
Re: calendario que devuelva formato fecha

¿Algo así?

Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<
html>
<
head>
<
titleSumador de checkboxes </title>
<
style>
td width:100pxtext-align:center; }
</
style>
</
head>

<
body>


<
table>
<
tr>
<
th>Uno</th>
<
th>Dos</th>
<
th>Tres</th>
<
th>Cuatro</th>
<
th>Cinco</th>
</
tr>
<
tr>
<
td><input type="checkbox" name="ch_1_1" /></td>
<
td><input type="checkbox" name="ch_1_2" /></td>
<
td><input type="checkbox" name="ch_1_3" /></td>
<
td><input type="checkbox" name="ch_1_4" /></td>
<
td><input type="checkbox" name="ch_1_5" /></td>
<
td><input type="button" value="Cuantos?" onclick="cuanto(1)"></td>
<
td><input type="text" value="0" name="caja_1" /></td>
</
tr>
<
tr>
<
td><input type="checkbox" name="ch_2_1" /></td>
<
td><input type="checkbox" name="ch_2_2" /></td>
<
td><input type="checkbox" name="ch_2_3" /></td>
<
td><input type="checkbox" name="ch_2_4" /></td>
<
td><input type="checkbox" name="ch_2_5" /></td>
<
td><input type="button" value="Cuantos?" onclick="cuanto(2)"></td>
<
td><input type="text" value="0" name="caja_2" /></td>
</
tr>
<
tr>
<
td><input type="checkbox" name="ch_3_1" /></td>
<
td><input type="checkbox" name="ch_3_2" /></td>
<
td><input type="checkbox" name="ch_3_3" /></td>
<
td><input type="checkbox" name="ch_3_4" /></td>
<
td><input type="checkbox" name="ch_3_5" /></td>
<
td><input type="button" value="Cuantos?" onclick="cuanto(3)"></td>
<
td><input type="text" value="0" name="caja_3" /></td>
</
tr>

</
table>


<
script>

var 
cuantosPorFila=5;
var 
precioPorUnidad=30;
function 
cuanto(fila) {
    var 
precioTotal=0;
    for(var 
i=1i<=5i++) {
        var 
elem=document.getElementsByName("ch_"+fila+"_"+i)[0];
        if(
elem.checkedprecioTotal+=precioPorUnidad;
    }
    
document.getElementsByName("caja_"+fila)[0].value=precioTotal;
}

</script>


</body>
</html> 
Si era lo de contar checkboxes, ya ves que es sencillo.
__________________
- Haz preguntas inteligentes, y obtendrás más y mejores respuestas.
- Antes de postearlo Inténtalo y Búscalo.
- Escribe correctamente tus mensajes.