The parent window (jsp) has a popup (child) button.
<input type="button" onclick="test();" value="Call Child Window" />
When you open the popup, there are text fields for the person to enter a word.
These input
are created dynamically, with a button and a function to create input
. The values entered in input
are stored in an array and qtdeCampos
is the number of fields.
The function of the buttons:
<script type="text/javascript">
var qtdeCampos = 0;
function addCampos() {
var objPai = document.getElementById("campoPai");
var objFilho = document.createElement("div");//Criando o elemento DIV;
objFilho.setAttribute("id","filho"+qtdeCampos);//Definindo atributos ao objFilho
objPai.appendChild(objFilho);//Inserindo o elemento no pai
//Escrevendo algo no filho recém-criado:
document.getElementById("filho"+qtdeCampos).innerHTML = "<input type='text' id='ctxt"+qtdeCampos+"' name='campo[]'>\n\<input type='button' onclick='removerCampo("+qtdeCampos+")' value='Apagar campo'>";
qtdeCampos++;
}
</script>
I would like to know how to pass this array of typed words into the popup for the parent page. The parent page will receive it in an array.