﻿
function validarEmail(valor) {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
        //alert("La dirección de email " + valor + " es correcta.")
        return (true)
    } else {
        //alert("La dirección de email es incorrecta.");
        return (false);
    }
}

function validarSiNumero(numero){
    if (!/^([0-9])*$/.test(numero))
        alert("El valor " + numero + " no es un número");
}

function validarCaracteres(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/[/\w/\s]/;  // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
} 

