Código Javascript:
Ver original
function txtvacio() { valor = document.forms["form1"]["alimentacion"].value; if(valor == "" || valor == null || valor.length == 0) { return false; } } function suma(){ suma=document.form1; suma.totalema.value=parseInt(suma.alimentacion.value)+parseInt(suma.combustible.value)+parseInt(suma.renta.value)+parseInt(suma.agua.value)+parseInt(suma.electricidad.value)+parseInt(suma.educacion.value)+parseInt(suma.telefono.value)+parseInt(suma.transporte.value)+parseInt(suma.gastosmedicos.value)+parseInt(suma.recreacion.value); var res = get_total(); $(".ema_final").val(res); } function get_total() { var r = 0; var total = $(".total_ema").val(); if (total <= 1500) { return r = 1 ; } if(total >= 1501 && total <= 2500) { return r = 2; } if(total >= 2501 && total <= 3500) { return r = 3; } if (total >= 3501 && total <= 4500) { return r = 4; } if(total > 4500) { return r = 5; } } function ValidaSoloNumeros() { if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false; }