Nov
21
2006

Validaciones para AJAX

Bueno validaciones para Ajax, quizás no es lo más correcto, son validaciones para Java Script, pero es lo que recomendaba recientemente en el post de AJAX + ASP

function IsNumeric(sText)
{
var ValidChars = “0123456789.”;
var IsNumber=true;
var Char;

for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf (Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}

function validarEmail(valor)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?

\w+)*(\.\w{2,3})+$/.test(valor)){
return (true)
} else {
return false;
}
}

 

Estas son muy útiles :)

Compartir:
  • Meneame
  • Digg
  • del.icio.us
  • BarraPunto
  • Facebook
  • Google
Escrito por deambulando en: Programación | Top

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

Aeros Theme | Wallpaper by GgarfielD |Deambulando.com 2006-2008 | Top