Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/07/2003, 19:06
ginocl
 
Fecha de Ingreso: enero-2002
Mensajes: 68
Antigüedad: 23 años, 2 meses
Puntos: 0
echale un viztazo a mi codigo please

<script language="JavaScript">
function verifydigit(texto)
{
largo = texto.length;

for (i=0; i < largo ; i++ )
{
if ( texto.charAt(i) != "0" &&
texto.charAt(i) != "1" && texto.charAt(i) != "2" &&
texto.charAt(i) != "3" && texto.charAt(i) != "4" &&
texto.charAt(i)!= "5" && texto.charAt(i) != "6" &&
texto.charAt(i) != "7" && texto.charAt(i)!= "8" &&
texto.charAt(i) != "9" && texto.charAt(i) != ".")
{
return false;
}
}
return true;
}


function Calcular()

{

if ( !verifydigit(document.forms[0].valor.value) ||
!verifydigit(document.forms[0].peso.value) ||
!verifydigit(document.forms[0].largo.value) ||
!verifydigit(document.forms[0].alto.value) ||
!verifydigit(document.forms[0].ancho.value)
)
{
alert("Utilice solo números en formato 99999999.99")
return false
}


return false;
}</script>

<form name="forma" action="calcuradora.asp" METHOD="POST" onsubmit="return Calcular();">
<input name="valor" size="10" value="<%=valor%>" >
<input name="b1" type="submit" value="Calcular" > </form>


hay mas texbox y mas codigo html para las tablas , pero creo que cone sto puedes entender ...