Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
proyecto-estandar
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Israel Gutierrez Salazar
proyecto-estandar
Commits
caf66a6a
Commit
caf66a6a
authored
Apr 02, 2018
by
Alonso Moreno Postigo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] v0.1
parent
94d0c27c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
18 deletions
+40
-18
validate_inputs.js
web/js/lib/validate_inputs.js
+14
-0
persona.js
web/js/pages/persona.js
+26
-18
persona.jsp
web/vistas/persona.jsp
+0
-0
No files found.
web/js/lib/validate_inputs.js
0 → 100644
View file @
caf66a6a
(
function
(
a
)
{
a
.
fn
.
validCampo
=
function
(
b
)
{
a
(
this
).
on
({
keypress
:
function
(
a
)
{
var
c
=
a
.
which
,
d
=
a
.
keyCode
,
e
=
String
.
fromCharCode
(
c
).
toLowerCase
(),
f
=
b
;
(
-
1
!=
f
.
indexOf
(
e
)
||
9
==
d
||
37
!=
c
&&
37
==
d
||
39
==
d
&&
39
!=
c
||
8
==
d
||
46
==
d
&&
46
!=
c
)
&&
161
!=
c
||
a
.
preventDefault
()
}
})
}
})(
jQuery
);
\ No newline at end of file
web/js/pages/persona.js
View file @
caf66a6a
...
...
@@ -179,14 +179,6 @@ let persona = {
reject
(
"Error al registrar personal"
)
}
})
fetchSo
(
'../PersonaServlet?accion=registrarPersona'
,
json
)
.
then
((
data
)
=>
{
resolve
(
data
)
})
.
catch
((
data
)
=>
{
reject
(
data
)
})
})
},
editar
()
{
...
...
@@ -319,14 +311,19 @@ let asignarEventos = () => {
persona
.
registrar
()
.
then
((
data
)
=>
{
customSwal
.
alert
(
'¡Exito!'
,
data
.
message
,
'success'
)
.
then
(()
=>
{
$
(
'#modal_registrar_persona'
).
modal
(
'hide'
)
})
.
then
(()
=>
{
persona
.
listar
()
})
if
(
data
.
status
)
{
customSwal
.
alert
(
'¡Exito!'
,
data
.
message
,
'success'
)
.
then
(()
=>
{
$
(
'#modal_registrar_persona'
).
modal
(
'hide'
)
})
.
then
(()
=>
{
persona
.
listar
()
})
}
else
{
customSwal
.
alert
(
'¡Error!'
,
data
.
message
,
'error'
)
}
})
.
catch
((
data
)
=>
{
customSwal
.
alert
(
'¡Error!'
,
data
.
message
,
'error'
)
...
...
@@ -395,8 +392,19 @@ let asignarEventos = () => {
}
})
}
let
validateInputs
=
()
=>
{
$
(
document
.
querySelector
(
'#txt-busqueda'
)).
validCampo
(
'abcdefghijklmnñopqrstuvwxyzáéíóú '
)
$
(
document
.
querySelector
(
'#txt_numero_documento'
)).
validCampo
(
'1234567890'
)
$
(
document
.
querySelector
(
'#txt_apellidos'
)).
validCampo
(
'abcdefghijklmnñopqrstuvwxyzáéíóú '
)
$
(
document
.
querySelector
(
'#txt_nombres'
)).
validCampo
(
'abcdefghijklmnñopqrstuvwxyzáéíóú '
)
$
(
document
.
querySelector
(
'#txt_edad'
)).
validCampo
(
'1234567890'
)
$
(
document
.
querySelector
(
'#txt_correo'
)).
validCampo
(
'abcdefghijklmnñopqrstuvwxyz1234567890._-@ '
)
}
jqueryValidateConfig
()
persona
.
listar
()
asignarEventos
()
limpiarCajasTexto
()
\ No newline at end of file
limpiarCajasTexto
()
validateInputs
()
\ No newline at end of file
web/vistas/persona.jsp
View file @
caf66a6a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment