I have a main form with a hidden variable in a parent php page.When i click a link in this page a popup window opens.In that popup window I have a form and the form action is self page.I have posted the form variables and stored it in php variables in the child form.I had set the value for the hidden variable of the parent page as an array of posted values in the child window using javascript.

Now If i submit the child form by clicking the submit button the values are not assigned to the hidden field of the parent page.If i click the submit form twice the values are assigned to the hidden variable.
I want the child form to submit only once and the values are set to the hidden field of the parent page when the child form submit button is clicked only once.How can i do this?