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
1
Merge Requests
1
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
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
07dd5804
Commit
07dd5804
authored
Nov 10, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Algunas validaciones en el form
parent
81f5c43c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
29 deletions
+65
-29
curriculumsearch/src/main/resources/static/main.js
+14
-9
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
+1
-1
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+50
-19
No files found.
curriculumsearch/src/main/resources/static/main.js
View file @
07dd5804
...
@@ -4,6 +4,7 @@ let cont_tecnologia = 0;
...
@@ -4,6 +4,7 @@ let cont_tecnologia = 0;
const
experiencias
=
[];
const
experiencias
=
[];
const
estudios
=
[];
const
estudios
=
[];
const
tecnologias
=
[];
const
tecnologias
=
[];
let
noValidateFlag
=
false
;
const
formValidator
=
function
()
{
const
formValidator
=
function
()
{
'use strict'
'use strict'
...
@@ -20,6 +21,7 @@ const formValidator = function () {
...
@@ -20,6 +21,7 @@ const formValidator = function () {
if
(
!
form
.
checkValidity
())
{
if
(
!
form
.
checkValidity
())
{
event
.
preventDefault
()
event
.
preventDefault
()
event
.
stopPropagation
()
event
.
stopPropagation
()
noValidateFlag
=
true
;
}
}
form
.
classList
.
add
(
'was-validated'
)
form
.
classList
.
add
(
'was-validated'
)
...
@@ -225,15 +227,18 @@ form.addEventListener("submit",(evt)=>{
...
@@ -225,15 +227,18 @@ form.addEventListener("submit",(evt)=>{
// evt.stopPropagation()
// evt.stopPropagation()
// }
// }
// form.classList.add('was-validated')
// form.classList.add('was-validated')
postData
(
'postulante'
,
serializeJSON
(
form
))
if
(
!
noValidateFlag
){
.
then
(
response
=>
{
postData
(
'postulante'
,
serializeJSON
(
form
))
if
(
response
.
status
==
200
||
response
.
status
==
302
){
.
then
(
response
=>
{
location
.
replace
(
response
.
url
);
if
(
response
.
status
==
200
||
response
.
status
==
302
){
}
else
{
location
.
replace
(
response
.
url
);
console
.
log
(
response
.
text
().
then
(
value
=>
console
.
log
(
value
)))
}
else
{
}
console
.
log
(
response
.
text
().
then
(
value
=>
console
.
log
(
value
)))
});
}
evt
.
preventDefault
();
});
evt
.
preventDefault
();
}
noValidateFlag
=
false
}
);
}
);
document
.
querySelector
(
"#btn-new-tech"
).
addEventListener
(
'click'
,()
=>
{
document
.
querySelector
(
"#tecnologia-nombre"
).
classList
.
remove
(
'd-none'
)})
document
.
querySelector
(
"#btn-new-tech"
).
addEventListener
(
'click'
,()
=>
{
document
.
querySelector
(
"#tecnologia-nombre"
).
classList
.
remove
(
'd-none'
)})
...
...
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
View file @
07dd5804
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<label>
Nombre: ${postulante.nombre}
</label><br>
<label>
Nombre: ${postulante.nombre}
</label><br>
<label>
Apellido ${postulante.apellido}
</label><br>
<label>
Apellido ${postulante.apellido}
</label><br>
<label>
Tipo de documento: ${postulante.tipoDocumento}
</label><br>
<label>
Tipo de documento: ${postulante.tipoDocumento}
</label><br>
<label>
Cedula: ${postulante.
ci
}
</label><br>
<label>
Cedula: ${postulante.
nroDocument
}
</label><br>
<label>
Correo: ${postulante.correo}
</label><br>
<label>
Correo: ${postulante.correo}
</label><br>
<label>
Departamento: ${postulante.getCiudad().getDepartamento().getNombre()}
</label><br>
<label>
Departamento: ${postulante.getCiudad().getDepartamento().getNombre()}
</label><br>
<label>
Ciudad: ${postulante.getCiudad().getNombre()}
</label><br>
<label>
Ciudad: ${postulante.getCiudad().getNombre()}
</label><br>
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
07dd5804
...
@@ -234,11 +234,11 @@
...
@@ -234,11 +234,11 @@
<div
class=
"inputs col-md-6"
>
<label
for=
"nivelIngles"
class=
"form-label"
>
Nivel de ingles
</label>
<div
class=
"inputs col-md-6"
>
<label
for=
"nivelIngles"
class=
"form-label"
>
Nivel de ingles
</label>
<select
name=
"nivelIngles"
id=
"nivelIngles"
class=
"bg-light"
>
<select
name=
"nivelIngles"
id=
"nivelIngles"
class=
"bg-light"
>
<option
value=
"1"
selected
>
1
</option>
<option
value=
"1"
selected
>
Ingles muy basico
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"2"
>
Comprendo algunas cosas y puedo leer con la ayuda del traductor
</option>
<option
value=
"3"
>
3
</option>
<option
value=
"3"
>
Puedo leer tranquilamente
</option>
<option
value=
"4"
>
4
</option>
<option
value=
"4"
>
Puedo escribir documentacion
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"5"
>
Puedo escribir y hablar tranquilamente
</option>
</select>
</select>
</div>
</div>
...
@@ -312,22 +312,22 @@
...
@@ -312,22 +312,22 @@
<form
name=
"experiencia-form"
class=
"needs-validation"
novalidate
>
<form
name=
"experiencia-form"
class=
"needs-validation"
novalidate
>
<div
class=
"inputs"
>
<div
class=
"inputs"
>
<label
for=
"institucion"
class=
"inputs form-label"
>
Institucion
</label>
<label
for=
"institucion
Experiencia
"
class=
"inputs form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"inputs form-control "
name=
"institucion"
id=
"institucion"
required
>
<input
type=
"text"
class=
"inputs form-control "
name=
"institucion"
id=
"institucion
Experiencia
"
required
>
</div>
</div>
<div
class=
"inputs"
>
<div
class=
"inputs"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<label
for=
"fechaDesde
Experiencia
"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control
"
name=
"fechaDesde"
id=
"fechaDesde
"
required
>
<input
type=
"date"
class=
"form-control
"
name=
"fechaDesde"
id=
"fechaDesdeExperiencia
"
required
>
</div>
</div>
<div
class=
"inputs"
>
<div
class=
"inputs"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<label
for=
"fechaHasta
Experiencia
"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control
"
name=
"fechaHasta"
id=
"fechaHast
a"
>
<input
type=
"date"
class=
"form-control
"
name=
"fechaHasta"
id=
"fechaHastaExperienci
a"
>
</div>
</div>
<div
class=
"inputs"
>
<div
class=
"inputs"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"text"
class=
"form-control
"
name=
"cargo"
id=
"cargo"
required
>
<input
type=
"text"
class=
"form-control "
name=
"cargo"
id=
"cargo"
required
>
</div>
</div>
<div
class=
"inputs"
>
<div
class=
"inputs"
>
...
@@ -434,8 +434,8 @@
...
@@ -434,8 +434,8 @@
<
%
--
<
label
for=
"tipoDeEstudio"
class=
"form-label"
>
Tipo De Estudio
</label>
--%>
<
%
--
<
label
for=
"tipoDeEstudio"
class=
"form-label"
>
Tipo De Estudio
</label>
--%>
<
%
--
<
input
type=
"text"
class=
"form-control "
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
>
--%>
<
%
--
<
input
type=
"text"
class=
"form-control "
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
>
--%>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<label
for=
"institucion
Estudio
"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control"
name=
"institucion"
id=
"institucion"
required
>
<input
type=
"text"
class=
"form-control"
name=
"institucion"
id=
"institucion
Estudio
"
required
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"temaDeEstudio"
class=
"form-label"
>
Carrera/Bachiller/Tema de Curso
</label>
<label
for=
"temaDeEstudio"
class=
"form-label"
>
Carrera/Bachiller/Tema de Curso
</label>
...
@@ -451,12 +451,12 @@
...
@@ -451,12 +451,12 @@
</select>
</select>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<label
for=
"fechaDesde
Estudio
"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
required
>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde
Estudio
"
required
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<label
for=
"fechaHasta
Estudio
"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta
Estudio
"
>
</div>
</div>
...
@@ -480,7 +480,38 @@
...
@@ -480,7 +480,38 @@
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<script>
<script>
var
ciudades
=
$
{
ciudades
};
var
ciudades
=
$
{
ciudades
};
(
function
(){
var
today
=
new
Date
();
var
dd
=
today
.
getDate
();
var
mm
=
today
.
getMonth
()
+
1
;
//January is 0!
var
yyyy
=
today
.
getFullYear
();
if
(
dd
<
10
)
{
dd
=
'0'
+
dd
;
}
if
(
mm
<
10
)
{
mm
=
'0'
+
mm
;
}
today
=
yyyy
+
'-'
+
mm
+
'-'
+
dd
;
let
fechaDesdeEstudio
=
document
.
querySelector
(
"#fechaDesdeEstudio"
);
let
fechaDesdeExperiencia
=
document
.
querySelector
(
"#fechaDesdeExperiencia"
);
let
fechaHastaEstudio
=
document
.
querySelector
(
"#fechaHastaEstudio"
);
let
fechaHastaExperiencia
=
document
.
querySelector
(
"#fechaHastaExperiencia"
);
fechaDesdeEstudio
.
setAttribute
(
"max"
,
today
);
fechaDesdeExperiencia
.
setAttribute
(
"max"
,
today
);
fechaDesdeExperiencia
.
addEventListener
(
"change"
,
()
=>
{
fechaHastaExperiencia
.
setAttribute
(
"min"
,
fechaDesdeExperiencia
.
value
)
})
fechaDesdeEstudio
.
addEventListener
(
"change"
,
()
=>
{
fechaHastaEstudio
.
setAttribute
(
"min"
,
fechaDesdeEstudio
.
value
)
})
})()
</script>
</script>
<script
src=
"./main.js"
></script>
<script
src=
"./main.js"
></script>
</body>
</body>
...
...
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