Forum Moderators: open

Message Too Old, No Replies

Pass form variables to POP UP

how to work on pop-up

         

rabi

10:47 am on Jan 22, 2009 (gmt 0)

10+ Year Member



Hi,
Its my first time here as I'm not getting any clue to solve this.
I want to submit form data to pop-up window,please tel me way how I can open child window on parent window.
as I don't only want to open popup but also want to display values of parent window form.
my parent form is

<form action="mycart.php?id=<?php echo $id;?>" method="post" >
<input type="text" value="" name="ch_qty" size="3" >
<input type="text" value="" name="y_qty" size="3" >
<input type="image" value="submit" name="submit" src="images/addtocart.jpg" align="right" border="0" height="20" >

this form is submittiong values to mycart.php but I want to open mycart.php as popup window.
How I can do this?
Regards,
Rabia

methode

7:28 pm on Jan 22, 2009 (gmt 0)

10+ Year Member



You could use a button instead a submit button with an onclick event attached, than that event would trigger a popup window.

It's something written really fast so I assume you'll have to modify it a bit:


<script type="text/javascript">
function popup(x,y){
url = 'http://the.page.you.want.to.pop.up.com/?ch_qty='+x+'&y_qty='+y+'&cahebust='+Math.random()
window.open(url, 'WindowName', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=400');

}
</script>
<form action="mycart.php?id=<?php echo $id;?>" method="post" >
<input type="text" value="" name="ch_qty" id="ch_qty" size="3" >
<input type="text" value="" name="y_qty" id="y_qty" size="3" >
<input type="button" value="Submit" onclick="popup(document.GetElementById('ch_qty').value,document.GetElementById('y_qty').value)" >


or something like that