|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/logicswapweb/aplicaciones/js/ |
Upload File : |
/******************************************************************************
* Funcion que valida un email con formato
******************************************************************************/
function restringir(evt, ascii) //event
{
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
return (key!=ascii);
}
/******************************************************************************
* Funcion que valida si hay espacios
******************************************************************************/
function sin_espacios(valor) //event
{
return (valor.indexOf(" ") == -1);
}
/******************************************************************************
* Funcion que valida si hay espacios en la posicion inicial
******************************************************************************/
function sin_espacios_inicial(valor)
{ //event
return (valor.charAt(0)!=" ");
}
/******************************************************************************
* Funcion que permite solo numeros
******************************************************************************/
function solo_numeros(evt)
{
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
return (key >= 48 && key <= 57);
}
/******************************************************************************
* Funcion que permite solo letras mayusculas y minusculas
******************************************************************************/
function solo_letras(evt)
{
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
return ((key >= 65 && key <= 90) || (key >= 97 && key <= 122));
}
/******************************************************************************
* Funcion que evalua si el ascii pertenece a una letra con tilde
******************************************************************************/
function letras_con_tilde(evt)
{
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
var val = new Array(193,201,205,211,218,225,233,237,243,250);
for(var i=0; i< val.length; i++){
if( key == val[i] ) return true;
}
return false;
}
/******************************************************************************
* Funcion que permite solo texto entre lo cual permite:
* Letras mayusculas y minusculas, tildes y espacios.
* No permite caracteres especiales ni numeros
******************************************************************************/
function solo_texto(evt)
{
if (solo_letras(evt) || letras_con_tilde(evt)) return true;
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
return (key == 32 || key == 241 || key == 209 || key == 46); //241 = �, 209= �
}
/******************************************************************************
* Funcion que valida un email con formato
******************************************************************************/
function validar_email(valor)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
return true
}
return false;
}
/******************************************************************************
* Funcion que limita el ingreso por teclado a un tama�o
* definido dentro de un textarea
******************************************************************************/
function limitetxtarea(fld, e, maxlimite)
{
var key = ''; // usada
if (fld.value.length >= maxlimite) return false;
return true;
}