This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Estructura y Datos de las Regiones, Provincias */ | |
/* y Comunas de Chile. */ | |
/* */ | |
/* Fecha: Julio 2010 */ | |
/* Autor: Juan Pablo Aqueveque - juque.cl */ | |
-- | |
-- Comunas | |
-- | |
DROP TABLE IF EXISTS `comunas`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Fn = { | |
// Valida el rut con su cadena completa "XXXXXXXX-X" | |
validaRut : function (rutCompleto) { | |
if (!/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test( rutCompleto )) | |
return false; | |
var tmp = rutCompleto.split('-'); | |
var digv = tmp[1]; | |
var rut = tmp[0]; | |
if ( digv == 'K' ) digv = 'k' ; | |
return (Fn.dv(rut) == digv ); |