scrupul0us
04-26-2006, 09:19 PM
Basically... when I click this here form button I need the popup to grab everything from a specific DIV on the main page (where the button was)
thanks
thanks
|
Click to See Complete Forum and Search --> : send div contents to a popup scrupul0us 04-26-2006, 09:19 PM Basically... when I click this here form button I need the popup to grab everything from a specific DIV on the main page (where the button was) thanks bpat1434 04-27-2006, 01:23 AM It's not technically sending the information to the page, but really the pop-up is reading from it's caller using the self.opener method. Basically, when you click the popup button/link a preset div is looked for in the parent window. If you need a dynamic pop-up, you'll have to figure something out. I gave you a good stepping stone. first page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> New Document </title> <meta name="Generator" content="EditPlus" /> <meta name="Author" content="" /> <meta name="Keywords" content="" /> <meta name="Description" content="" /> <script language="JavaScript" type="text/javascript"><!-- function popWindow() { var pop = window.open('info.html','','width=400,height=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no'); if(pop.focus){ pop.focus(); } } --></script> </head> <body> <input type="button" name="click" value="Pop Up!!" onclick="javascript:popWindow();"/> <div id="info" style="visibility: hidden;"> Test test test...<b>SOme Test content</b> </div> </body> </html> info.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> Requested Info </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <script language="JavaScript" type="text/javascript"><!-- function showIt() { var cont = self.opener.document.getElementById('info').innerHTML; document.getElementById('info').innerHTML = cont; } window.onload = function(e){ showIt(); } --></script> </head> <body> <div id="info"></div> </body> </html> Alternatively if it's multiple forms or something... you can do something like this: first page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <script type="text/javascript" language="JavaScript"> <!-- function popWindow(wName){ features = 'width=400,height=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no'; pop = window.open('',wName,features); if(pop.focus){ pop.focus(); } return true; } --> </script> </head> <body> <form action="js_pop.php" method="post" target="Details" onSubmit="return popWindow(this.target)"> <input type="hidden" name ="age" value="23 years old"> <input type="hidden" name="experience" value="expert"> <input type="submit" value="John"> </form> <form action="js_pop.php" method="post" target="Details" onSubmit="return popWindow(this.target)"> <input type="hidden" name ="age" value="26 years old"> <input type="hidden" name="experience" value="novice"> <input type="submit" value="James"> </form> <form action="js_pop.php" method="post" target="Details" onSubmit="return popWindow(this.target)"> <input type="hidden" name ="age" value="21 years old"> <input type="hidden" name="experience" value="intermediate"> <input type="submit" value="Jack"> </form> </body> </html> js_pop.php <pre><?php var_dump($_POST); ?></pre> And display only the form that they hit the button in. That was created for an earlier post on here, but I cant' seem to find it now.... hmm..... scrupul0us 04-27-2006, 10:01 AM after some tweaking I'ev got the basic functionality down... when i press the form submit button i get my popup and it draws the div containing the form into it... but, if I enter any information into the form, then clickthe button, I just get a blank popup i might have to submit the form back to itself putting the values into the html FIRST and THEN allowing the user to "popup" the form for printing lest you know why its blowing up PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved. |