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
bce55aca
Commit
bce55aca
authored
Nov 01, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminar experiencias js
parent
3d8622d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
20 deletions
+13
-20
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+2
-1
curriculumsearch/src/main/resources/static/main.js
+11
-6
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+0
-13
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
bce55aca
...
...
@@ -33,7 +33,8 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
System
.
out
.
println
(
postulante
.
getExperiencias
().
get
(
0
).
getCargo
());
return
"redirect:/"
;
}
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
bce55aca
...
...
@@ -18,19 +18,24 @@ function agregarFieldExpierncia(evt){
<input type="cargo" class="form-control " name="experiencia-
${
cont_experiencia
}
-cargo" id="cargo" >
<label for="refNombre" class="form-label">Referencia Nombre</label>
<input type="text" class="form-control " name="experiencia-
${
cont_experiencia
}
-referencias" id="refNombre" >
<button type="button" onclick="eliminarExperiencia(event)">Eliminar</button>
`
;
nee
.
className
=
"mb-3 col-5"
form
.
insertBefore
(
nee
,
btn
)
}
function
eliminarExperiencia
(
event
)
{
event
.
target
.
parentElement
.
remove
()
}
function
serializeJSON
(
form
)
{
// Create a new FormData object
const
formData
=
new
FormData
(
form
);
// Create an object to hold the name/value pairs
const
pairs
=
{};
const
experiencias
=
[
{}
];
const
estudios
=
[
{}
];
const
tecnologias
=
[
{}
];
const
experiencias
=
[];
const
estudios
=
[];
const
tecnologias
=
[];
// Add each name/value pair to the object
for
(
const
[
name
,
value
]
of
formData
)
{
...
...
@@ -60,9 +65,9 @@ function serializeJSON (form) {
}
}
}
pairs
[
"experiencias"
]
=
experiencias
pairs
[
"estudios"
]
=
estudios
pairs
[
"tecnologias"
]
=
tecnologias
pairs
[
"experiencias"
]
=
experiencias
.
filter
(
exp
=>
exp
)
//eliminacion de nulos
pairs
[
"estudios"
]
=
estudios
.
filter
(
est
=>
est
)
//eliminacion de nulos
pairs
[
"tecnologias"
]
=
tecnologias
.
filter
(
tec
=>
tec
)
//eliminacion de nulos
// Return the JSON string
return
JSON
.
stringify
(
pairs
,
null
,
2
);
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
bce55aca
...
...
@@ -68,19 +68,6 @@
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
>
</div>
<div
class=
"mb-3 col-5"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control "
name=
"experiencia-0-institucion"
id=
"institucion"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
FechaDesde
</label>
<input
type=
"date"
class=
"form-control "
name=
"experiencia-0-fechaDesde"
id=
"fechaDesde"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"experiencia-0-fechaHasta"
id=
"fechaHasta"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"cargo"
class=
"form-control "
name=
"experiencia-0-cargo"
id=
"cargo"
>
<label
for=
"refNombre"
class=
"form-label"
>
Referencia Nombre
</label>
<input
type=
"text"
class=
"form-control "
name=
"experiencia-0-referencias"
id=
"refNombre"
>
</div>
<button
type=
"button"
name=
"addExp"
onclick=
"agregarFieldExpierncia(event)"
>
Agregar
</button>
...
...
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