
04/11/2008, 13:55
|
| | Fecha de Ingreso: noviembre-2006
Mensajes: 83
Antigüedad: 18 años, 5 meses Puntos: 0 | |
Respuesta: duda con suma de campos generados por php y myql var valorTotal = 0;
var tot = 0;
var val = 0;
function detect(obj) {
var number = obj.id.substr(6, obj.id.length - 6); /* Obtener desde la sexta posición hasta el final */
document.form1["valor"+number].value = Math.ceil(document.form1["cantidad"+number].value * document.form1["precio"+number].value)
tot = parseInt(document.form1.total.value)
val = parseInt(document.form1["valor"+number].value)
document.form1.total.value = tot + val
}
function resta(obj) {
var number = obj.id.substr(6, obj.id.length - 6); /* Obtener desde la sexta posición hasta el final */
tot = parseInt(document.form1.total.value)
val = parseInt(document.form1["valor"+number].value)
document.form1.total.value = tot - val
}
creo q por ahi anda |