PDA

View Full Version : How to collect data from a seperate document


Dunna
08-04-2004, 06:05 PM
I'm writing an online game (In perl w/cgi, of course) in which I would like the users to be able to click a button, open a seperate window, select options, and then pass the perl data from that form back to the one which originally opened it. There's probably a simple solution I'm not coming up with. Code or links appreciated!

MattJakel
08-05-2004, 05:51 AM
You can use this (http://developer.irt.org/script/40.htm) (http://developer.irt.org/script/40.htm) to open a link in the original window, but I don't know of a way to directly pass form information back to that window. What you may have to do is pass the data through the URL and use JavaScript to place that data in the form... But that is a roundabout way (as are most of the things i come up with :o ). I'm sure someone else on the forum can help you find a more direct way to do this ;)

Hope this helps!
Matt

mlseim
08-05-2004, 01:03 PM
It will be tough to do without having to refresh the original form page.

If the original form (the one that first displays and opens the new window)
were actually created "dynamically" using Perl, it would be a snap to display another form dynamically, then, re-display the original form with all information filled in. By "dynamically", I mean, the HTML form pages are not just static pages (URLS), they are themselves Perl scripts.

Cookies could also be used to retain data even if a user accidently closes a necessary window and comes back again ... the data is retained. The Perl script checks for and reads any cookie information previously saved.

I mention this because it could really be done without Javascripting. This might be important since many people are now turning off their browser javascripting capabilities.