Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amparo Oliver
th-app-java
Commits
19be8b2c
Commit
19be8b2c
authored
Nov 04, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Algunas validaciones
parent
8a0d1990
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
17 deletions
+74
-17
curriculumsearch/src/main/java/com/roshka/modelo/TipoDeEstudio.java
+1
-0
curriculumsearch/src/main/resources/static/main.js
+59
-3
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+14
-14
No files found.
curriculumsearch/src/main/java/com/roshka/modelo/TipoDeEstudio.java
View file @
19be8b2c
...
...
@@ -6,6 +6,7 @@ public enum TipoDeEstudio {
TERCIARIO
(
"Terciario"
),
SECUNDARIO
(
"Secundario"
),
CURSO
(
"Curso"
),
POSTGRADO
(
"Post Grado"
),
OTRO
(
"Otro"
);
private
final
String
name
;
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
19be8b2c
...
...
@@ -36,8 +36,10 @@ function agregarFieldExpierncia(event){
let
pos_rec
;
let
returnFlag
=
false
;
let
requiredValues
=
[
"institucion"
,
"cargo"
,
"fechaDesde"
]
formData
.
forEach
((
value
,
key
)
=>
{
if
(
(
key
===
"institucion"
||
key
===
"cargo"
||
key
===
"fechaDesde"
)
if
(
requiredValues
.
includes
(
key
)
&&
value
===
""
&&
returnFlag
==
false
){
console
.
log
(
key
,
value
)
returnFlag
=
true
;
...
...
@@ -45,7 +47,12 @@ function agregarFieldExpierncia(event){
});
if
(
returnFlag
===
true
){
alert
(
"Rellene Institucion, Fechas y Cargo como minimo"
);
let
message
=
"Rellene "
for
(
let
i
=
0
;
i
<
requiredValues
.
length
;
i
++
){
message
+=
", "
+
requiredValues
[
i
];
}
message
+=
" como minimo."
alert
(
message
);
return
;
}
...
...
@@ -57,7 +64,7 @@ function agregarFieldExpierncia(event){
else
{
pairs
[
name
]
=
value
}
}
pairs
[
"reconocimientos"
]
=
reconocimientos
.
filter
(
rec
=>
rec
.
nombre
);
experiencias
[
cont_experiencia
]
=
pairs
;
...
...
@@ -89,6 +96,30 @@ function agregarFieldTecnologia(){
const
pairs
=
{};
const
formtecn
=
document
.
querySelector
(
"[name=tecnologia-form]"
);
const
formData
=
new
FormData
(
formtecn
);
//Validacion
let
returnFlag
=
false
;
let
requiredValues
=
[
"nombre"
,
"nivel"
]
formData
.
forEach
((
value
,
key
)
=>
{
if
(
requiredValues
.
includes
(
key
)
&&
value
===
""
&&
returnFlag
==
false
){
console
.
log
(
key
,
value
)
returnFlag
=
true
;
}
});
if
(
returnFlag
===
true
){
let
message
=
"Rellene "
for
(
let
i
=
0
;
i
<
requiredValues
.
length
;
i
++
){
message
+=
", "
+
requiredValues
[
i
];
}
message
+=
" como minimo."
alert
(
message
);
return
;
}
for
(
const
[
name
,
value
]
of
formData
){
pairs
[
name
]
=
value
}
...
...
@@ -205,6 +236,31 @@ function agregarFieldEstudio(){
let
pairs
=
{};
const
formest
=
document
.
querySelector
(
"[name=estudio-form]"
);
const
formData
=
new
FormData
(
formest
);
//Validacion
let
returnFlag
=
false
;
let
requiredValues
=
[
"tipoDeEstudio"
,
"institucion"
,
"estado"
,
"fechaDesde"
,
"temaDeEstudio"
]
formData
.
forEach
((
value
,
key
)
=>
{
if
(
requiredValues
.
includes
(
key
)
&&
value
===
""
&&
returnFlag
==
false
){
console
.
log
(
key
,
value
)
returnFlag
=
true
;
}
});
if
(
returnFlag
===
true
){
let
message
=
"Rellene "
for
(
let
i
=
0
;
i
<
requiredValues
.
length
;
i
++
){
message
+=
", "
+
requiredValues
[
i
];
}
message
+=
" como minimo."
alert
(
message
);
return
;
}
const
estudioReconocimiento
=
[{},{},{}];
let
pos_rec
;
for
(
const
[
name
,
value
]
of
formData
){
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
19be8b2c
...
...
@@ -282,15 +282,15 @@
</button>
</div>
<div
class=
"modal-body"
>
<form
name=
"experiencia-form"
>
<form
name=
"experiencia-form"
class=
"needs-validation"
novalidate
>
<div
class=
"inputs"
>
<label
for=
"institucion"
class=
"inputs form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"inputs form-control "
name=
"institucion"
id=
"institucion"
>
<input
type=
"text"
class=
"inputs form-control "
name=
"institucion"
id=
"institucion"
required
>
</div>
<div
class=
"inputs"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
required
>
</div>
<div
class=
"inputs"
>
...
...
@@ -300,12 +300,12 @@
<div
class=
"inputs"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"text"
class=
"form-control "
name=
"cargo"
id=
"cargo"
>
<input
type=
"text"
class=
"form-control "
name=
"cargo"
id=
"cargo"
required
>
</div>
<div
class=
"inputs"
>
<label
for=
"descripcion"
class=
"form-label"
>
Descripcion
</label>
<textarea
class=
"form-control "
name=
"descripcion"
id=
"descripcion"
>
</textarea>
<textarea
class=
"form-control "
name=
"descripcion"
id=
"descripcion"
>
</textarea>
</div>
<div
class=
"inputs"
>
...
...
@@ -366,10 +366,10 @@
</button>
</div>
<div
class=
"modal-body"
>
<form
name=
"tecnologia-form"
>
<form
name=
"tecnologia-form"
class=
"needs-validation"
novalidate
>
<label
for=
"tecnologia-nombre"
class=
"form-label"
>
Tecnologia
</label>
<div
class=
"input-group mb-3"
>
<select
class=
"form-select"
name=
"tecnologia-id"
aria-label=
"Default select example"
>
<select
class=
"form-select"
name=
"tecnologia-id"
aria-label=
"Default select example"
required
>
<option
value=
"-1"
selected
>
Open this select menu
</option>
<c:forEach
items=
"${tecnologias}"
var=
"tecnologia"
>
<option
value=
"${tecnologia.id}"
>
${tecnologia.nombre}
</option>
...
...
@@ -381,7 +381,7 @@
<input
type=
"text"
class=
"form-control d-none"
name=
"tecnologia-nombre"
id=
"tecnologia-nombre"
>
<label
for=
"nivel"
class=
"form-label"
>
Nivel
</label>
<input
type=
"number"
class=
"form-control"
name=
"nivel"
id=
"nivel"
>
<input
type=
"number"
class=
"form-control"
name=
"nivel"
id=
"nivel"
required
>
</form>
</div>
<div
class=
"modal-footer"
>
...
...
@@ -405,12 +405,12 @@
</button>
</div>
<div
class=
"modal-body"
>
<form
name=
"estudio-form"
>
<form
name=
"estudio-form"
class=
"needs-validation"
novalidate
>
<div
class=
"form-group"
>
<label
for=
"tipoDeEstudio"
>
Tipo de Estudio
</label>
<select
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
>
<select
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
required
>
<option
value=
"-1"
selected
disabled
hidden
>
Seleccionar
</option>
<c:forEach
items=
"${tiposDeEstudio}"
var=
"tipo"
>
<option
value=
"${tipo}"
>
${tipo.name}
</option>
...
...
@@ -421,15 +421,15 @@
<
%
--
<
input
type=
"text"
class=
"form-control "
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
>
--%>
<div
class=
"form-group"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control"
name=
"institucion"
id=
"institucion"
>
<input
type=
"text"
class=
"form-control"
name=
"institucion"
id=
"institucion"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"temaDeEstudio"
class=
"form-label"
>
Carrera/Bachiller/Tema de Curso
</label>
<input
type=
"text"
class=
"form-control"
name=
"temaDeEstudio"
id=
"temaDeEstudio"
>
<input
type=
"text"
class=
"form-control"
name=
"temaDeEstudio"
id=
"temaDeEstudio"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"estado"
>
Estado
</label>
<select
name=
"estado"
id=
"estado"
>
<select
name=
"estado"
id=
"estado"
required
>
<option
value=
"-1"
selected
disabled
hidden
>
Seleccionar
</option>
<c:forEach
items=
"${estadosEstudio}"
var=
"estado"
>
<option
value=
"${estado}"
>
${estado.name}
</option>
...
...
@@ -438,7 +438,7 @@
</div>
<div
class=
"form-group"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
...
...
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