From: Tony M. <to...@ht...> - 2005-02-09 03:15:14
|
On Tue, 8 Feb 2005, Steven Levin wrote: > On Sat, 2005-02-05 at 22:06 -0500, Tony Miller wrote: > > Any ideas on why this wouldn't work? > > I normally use the get DOM function getElementById() > > So you would do something like this: > > if(isset($_REQUEST["lay_quiet"])) > $tags["START_FORM"] = "<form id=\"myformid\" action=\"index.php\" method=\"post\" name=\"editcigar\">"; > > Make sure you confirm this is properly making it into the html source. > > Then in the form template file at the bottom put: > > <script type="text/javascript"> > //<![CDATA[ > > document.getElementById('myformid').onsubmit = function doSomething() { > // whatever you gotta do > // opener.document.reload(); > // window.close(); > return true; > } > > //]]> > </script> Thanks for the suggestion, I seem to be hitting the javascript on submit, the window is closing, the parent form is refreshing, but the information is not being submitted. Here are snippets of the generated HTML. <form id="editcigarid" name="editcigar" action="index.php" method="post"> <input type="hidden" name="module" value="cigardiary" /> <input type="hidden" name="CC_OP" value="save" /> ... <script type="text/javascript"> //<![CDATA[ document.getElementById('editcigarid').onsubmit=function dropWindow() { window.opener.location.reload(true); window.close(); return true; } //]]> </script> It should be returning true to the "onsubmit" forcing it to submit the data to the server. So far in my travels I've been able to either 1. Save the data and not close the popup and refresh the parent window. 2. Close the popup and refresh the parent window but not save the data. > > Is there any better way to get extra information into the <form> tag? > > Currently there is not an easier way :( I don't care if it's easier, just so long as it works. I think I'm getting close with your help. > Hope this helps. It did help, but I'm not there yet. There's some interaction with onsubmit that I don't understand. Anyone with ideas, please speak up. -Tony -- Hometown Enterprises Internet Services Professional, affordable web design and hosting. http://www.hteis.com/ |