Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/07/2009, 08:57
Avatar de uselox
uselox
 
Fecha de Ingreso: agosto-2008
Ubicación: Lima, Perú
Mensajes: 168
Antigüedad: 15 años, 8 meses
Puntos: 12
De acuerdo Respuesta: ejecucion de funcion termina en for?

Código HTML:
<script type="text/javascript">
function isNum(string) {
	var valor = 0;
	for (var i = 0, length = string.length; i < length; i++) {
		valor = parseInt(string.charAt(i));
		if(isNaN(valor)) return false;
	}
	return true;
}
function idForm(ff){
	var campotemp;
	var total = 0, value;
	for(var a=0, length = ff.elements.length; a < length; a++)  {
		if(ff.elements[a].type == 'text'){
			value = ff.elements[a].value;
			if(value != '' && isNum(value)){
				campotemp = parseInt(value);
				total += campotemp;
			} else return false;
		}
       	}
       	alert(total);
}
</script>