rekha Posted February 27, 2008 Share Posted February 27, 2008 Hi 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? Pls help......... Regards Rekha http://hiox.org Link to comment https://forums.phpfreaks.com/topic/93320-to-send-the-form-values-of-a-child-window-to-a-parent-window/ Share on other sites More sharing options...
rekha Posted February 28, 2008 Author Share Posted February 28, 2008 Hi Any answers??? Regards Rekha http://hiox.org Link to comment https://forums.phpfreaks.com/topic/93320-to-send-the-form-values-of-a-child-window-to-a-parent-window/#findComment-478860 Share on other sites More sharing options...
Lijoyx Posted February 28, 2008 Share Posted February 28, 2008 hai rek can u show me the code now. i may be able to help u. Link to comment https://forums.phpfreaks.com/topic/93320-to-send-the-form-values-of-a-child-window-to-a-parent-window/#findComment-478917 Share on other sites More sharing options...
rekha Posted February 29, 2008 Author Share Posted February 29, 2008 Hi I have a form in parent php page <form name=add> <input type=hidden name=cus> </form> In child window i have a form like this <form name=sub method=post action="<?php echo $PHP_SELF;?>" onsubmit="jss()"> <input type=text name=ss> <input type=text name=cc> <input type=submit value=run> </form> I have posted the values and stored it in a array as follows $ss=$_POST['ss']; $cc=$_POST['cc']; $array=array($ss,$cc); I used javascript function to set the array values to the hidden field in parent window. function jss() { window.opener.document.add.cus.value="<?php echo base64_encode(serialize($array));?>"; } When i post the values of hidden field in parent window $arr=unserialize(base64_decode($_POST['cus'])); The values are assigned when i click the submit button of the child window twice.I want to set the values when submit button is clicked only once. Pls help........ Regards Rekha Link to comment https://forums.phpfreaks.com/topic/93320-to-send-the-form-values-of-a-child-window-to-a-parent-window/#findComment-479764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.