diff --git a/curriculumsearch/src/main/resources/static/main.js b/curriculumsearch/src/main/resources/static/main.js index 65bef17..c065837 100644 --- a/curriculumsearch/src/main/resources/static/main.js +++ b/curriculumsearch/src/main/resources/static/main.js @@ -89,4 +89,57 @@ form.addEventListener("submit",(evt)=>{ location.replace(response.url); }); evt.preventDefault(); -} ); \ No newline at end of file +} ); + + + +//Metodos para Estudios + + + +function agregarFieldEstudio(){ + //recoger del form + const pairs = {}; + const formest = document.querySelector("[name=estudio-form"); + const formData = new FormData(formest); + for (const [name, value] of formData){ + pairs[name] = value + } + estudios[cont_estudios] = pairs; + formest.reset(); + //imprimir lista actualizada + const div = document.querySelector("#estudios") + const div1 = document.createElement('div'); + let content='" + div1.innerHTML = content + div.innerHTML = ''; + div.appendChild(div1); + cont_estudios++; + +} + +function eliminarEstudio(event) { + //eliminar del array + estudios[event.target.parentElement.id.split("-")[1]]=null + //eliminar en html + event.target.parentElement.remove() +} + + + + + + diff --git a/curriculumsearch/src/main/webapp/jsp/postulante-form.jsp b/curriculumsearch/src/main/webapp/jsp/postulante-form.jsp index 7c1d241..ba8fa3d 100644 --- a/curriculumsearch/src/main/webapp/jsp/postulante-form.jsp +++ b/curriculumsearch/src/main/webapp/jsp/postulante-form.jsp @@ -66,19 +66,22 @@
-
- - - + +
-
- -
+
+
+ +

+
+