PageSourceSearch

https://chilexpress.cl/Resources/Scripts/Controles/ValidaUnete.js?v=134353866564523910

js chilexpress.cl collected 2026-10-02 03:51:20 UTC 3,248 bytes, 157 lines download raw bytes

1$(document).ready(function () {
2
3	$('#name').focusout(function () {
4		if ($('#name').val() != "") {
5			if (!validaNombre(name.value)) {
6				$('#name').val("");
7				return false;
8			}
9		}
10	});
11
12
13	$('#firstName').focusout(function () {
14		if ($('#firstName').val() != "") {
15			if (!validaApellido(firstName.value)) {
16				$('#firstName').val("");
17				return false;
18			}
19		}
20	});	
21
22	$('#nacimiento').focusout(function () {
23		if ($('#nacimiento').val() != "") {
24		   if (!validarFormatoFecha(nacimiento.value )) {
25		   	$('#nacimiento').val("");
26		   	return false;
27		   }
28		}
29	});
30
31	$('#email').focusout(function () {
32		if ($('#email').val() != "") {
33		    if (!validarEmail(email.value)) {
34		    	$('#email').val("");
35		    	return false;
36		    }
37		}
38	});
39
40
41	$('#phone').focusout(function () {
42		if ($('#phone').val() != "") {
43			if (!ValTelefo(phone.value)) {
44				$('#phone').val("");
45				return false;
46			}
47		}
48	});
49});
50
51
52function validaNombre(nombre) {
53	if (/^[a-zA-Z]+[a-zA-Z]+$/.test(nombre)) {
54		return true;
55	}
56	else {
57		$('#name').val("");
58		return false;
59	}
60}
61
62
63function validaApellido(apell) {
64	if (/^[a-zA-Z]+[a-zA-Z]+$/.test(apell)) {
65		return true;
66	}
67	else {
68		$('#firstName').val("");
69		return false;
70	}
71}
72
73
74function validarFormatoFecha(fecha) {
75	if (/^\d{1,2}\/\d{1,2}\/\d{2,4}$/.test(fecha)) {
76		return true;
77	}
78	else {
79		$('#nacimiento').val("");
80		return false;
81	}	
82}
83
84function validarEmail(correo) {
85	if (/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(correo)) {
86		return true;
87	} else {
88		$('#email').val("");
89		return false;
90	}
91}
92
93function ValTelefo(telef) {
94	if (/\x2b[0-9]+/.test(telef)) {
95		return true;
96	}
97	else {
98		$('#phone').val("");
99		return false;
100	}
101}
102function soloLetrasNombre(e) {
103	var key = e.keyCode || e.which,
104		tecla = String.fromCharCode(key).toLowerCase(),
105		letras = " áéíóúabcdefghijklmnñopqrstuvwxyz",
106		especiales = [8, 13],
107		tecla_especial = false;
108
109	for (var i in especiales) {
110		if (key == especiales[i]) {
111			tecla_especial = true;
112			break;
113		}
114	}
115
116	if (letras.indexOf(tecla) == -1 && !tecla_especial) {
117		return false;
118	}
119}
120
121
122function soloLetrasApell(e) {
123    var key = e.keyCode || e.which,
124      tecla = String.fromCharCode(key).toLowerCase(),
125      letras = " áéíóúabcdefghijklmnñopqrstuvwxyz",
126      especiales = [8, 13, 45],
127      tecla_especial = false;
128
129    for (var i in especiales) {
130      if (key == especiales[i]) {
131        tecla_especial = true;
132        break;
133      }
134    }
135
136    if (letras.indexOf(tecla) == -1 && !tecla_especial) {
137      return false;
138    }
139 }
140
141function SoloLetrasYNumeros(e) {
142     var key = e.keyCode || e.which,
143     	tecla = String.fromCharCode(key).toLowerCase(),
144     	letras = " áéíóúabcdefghijklmnñopqrstuvwxyz0123456789",
145     	especiales = [8, 13],
146     	tecla_especial = false;
147     
148     for (var i in especiales) {
149     	if (key == especiales[i]) {
150     		tecla_especial = true;
151     		break;
152     	}
153     }
154       if (letras.indexOf(tecla) == -1 && !tecla_especial) {
155       	return false;
156       }  
157}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.