Me explico.
Cree un formulario con JavaScript, en el cual pide el Puesto de Trabajo y el Nomre de la Persona. El usuario puede ir agregando estos dos campos dándole a un botón. Así se le van añadiendo mas.
El JavaScript esta así:
Código Javascript:
Ver original
<script language="JavaScript" type="text/javascript"> function elemento_file(x){ var divele=document.getElementById("elementos"); if(x==1){ if(divele.lastChild){ divele.removeChild(divele.lastChild); divele.removeChild(divele.lastChild); divele.removeChild(divele.lastChild); divele.removeChild(divele.lastChild); divele.removeChild(divele.lastChild); divele.removeChild(divele.lastChild); } } else { salto=document.createElement("br"); puesto=document.createTextNode("Puesto"); nombre=document.createTextNode("Nombre"); ele=document.createElement("input"); ele2=document.createElement("input"); separacion=document.createElement("hr"); ele.type="text"; ele.name="mielemento[]"; ele2.type="text"; ele.name="mielemento2[]"; divele.appendChild(puesto); divele.appendChild(ele); divele.appendChild(salto); divele.appendChild(nombre); divele.appendChild(ele2); divele.appendChild(separacion); } } </script>
Ahora mi problema es que quiero guardar la información que el usuario me pone en mielemento y en mielemento2, que son el Puesto y el Nombre respectivamente,
en una variable $_SESSION ya que la voy a utilizar mas adelante. Pero es que no tengo ni la mas mínima idea de como hacerlo. ¿Alguna sugerencia?, si les falta alguna información pídanla. Gracias.