Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/07/2008, 11:15
Rockzilla
 
Fecha de Ingreso: julio-2008
Mensajes: 129
Antigüedad: 16 años, 8 meses
Puntos: 0
Respuesta: Problema de representacion de porcentaje con color

bueno aqui realic o modifique mi funcion pero solo me muestra el fondo amarillo
<SCRIPT language=JavaScript>


function perc1() {
a = document.form1.a.value/100;
b = a*40;
document.form1.total1.value = 40
}
function perc2() {
a = document.form1.c.value;
b = 40;
c = a/40;
d = c*100;
f = d + x
document.form1.total2.value = d
var x = Math.random()
//document.write(x)
x = new String (x)
x = x.substring(x.length -1)
//document.write(x)
if (x <=45){ document.bgColor='yellow'}
else {
if (x <=75){ document.bgColor='green'}
else {
if (x <= 100){ document.bgColor='red'}

}
}


}



}

//-->
</SCRIPT>