Commit 47c894fca13218091d9e0dbc727f1c4623fc5c54
1 parent
0fe898fc64
Exists in
develop
separar funciones, tlf length
Showing
3 changed files
with
10 additions
and
6 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -223,13 +223,15 @@ angular.module('focaAbmChofer') |
223 | 223 | $location.path('/chofer/' + chofer.id + '/' + chofer.idTransportista); |
224 | 224 | } |
225 | 225 | |
226 | - $scope.validarDatosChofer = function(chofer) { | |
226 | + $scope.validarChoferNombre = function(chofer) { | |
227 | 227 | // No permito numero ni caracteres especiles en nombre de chofer |
228 | 228 | if (!/^([a-zA-ZÀ-ÿ ])*$/.test(chofer.nombre)) { |
229 | 229 | focaModalService.alert('el campo Nombre no debe incluir números o símbolos'); |
230 | 230 | chofer.nombre = ''; |
231 | 231 | return |
232 | 232 | } |
233 | + } | |
234 | + $scope.validarChoferDni = function(chofer) { | |
233 | 235 | // Solo numeros en el campo documento |
234 | 236 | if (!/^([0-9])*$/.test(chofer.dni)) { |
235 | 237 | focaModalService.alert('el campo DNI solo puede incluir números'); |
src/views/foca-abm-choferes-item.html
src/views/foca-abm-choferes-listado.html
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | type="text" |
40 | 40 | teclado-virtual |
41 | 41 | ng-model="chofer.nombre" |
42 | - ng-keyup="validarDatosChofer(chofer)" | |
42 | + ng-keyup="validarChoferNombre(chofer)" | |
43 | 43 | ng-required="true" |
44 | 44 | ng-keypress="next($event.keyCode)" |
45 | 45 | foca-focus="focused == 1" |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | maxlength="12" |
66 | 66 | minlength="2" |
67 | 67 | ng-model="chofer.dni" |
68 | - ng-keyup="validarDatosChofer(chofer)" | |
68 | + ng-keyup="validarChoferDni(chofer)" | |
69 | 69 | ng-required="true" |
70 | 70 | ng-keypress="next($event.keyCode)" |
71 | 71 | foca-focus="focused == 2" |
... | ... | @@ -106,7 +106,7 @@ |
106 | 106 | class="form-control" |
107 | 107 | type="text" |
108 | 108 | teclado-virtual |
109 | - ng-keyup="validarDatosChofer(chofer)" | |
109 | + ng-keyup="validarChoferNombre(chofer)" | |
110 | 110 | ng-model="chofer.nombre" |
111 | 111 | ng-required="true" |
112 | 112 | ng-keypress="next($event.keyCode)" |
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | type="text" |
133 | 133 | teclado-virtual |
134 | 134 | ng-model="chofer.dni" |
135 | - ng-keyup="validarDatosChofer(chofer)" | |
135 | + ng-keyup="validarChoferDni(chofer)" | |
136 | 136 | ng-required="true" |
137 | 137 | ng-keypress="next($event.keyCode)" |
138 | 138 | foca-focus="focused == 2" |
... | ... | @@ -148,7 +148,8 @@ |
148 | 148 | foca-tipo-input |
149 | 149 | teclado-virtual |
150 | 150 | solo-positivos |
151 | - limite-numeros-max="15" | |
151 | + limite-numeros-max="10" | |
152 | + maxlength="10" | |
152 | 153 | ng-model="chofer.telefono" |
153 | 154 | ng-required="true" |
154 | 155 | foca-focus="focused == 3" |