View Full Version : Sending data from one HTML document to another
a2jfreak
25 Mar 2004, 12:35am
Say I have first.html and it has a text input box: <input type="text" name="blank">
Say I want to fill that box with "blah blah blah" found in second.html
How do I, from first.html, open second.html and send the data found there to the input box in first.html? (I don't want to reload first.html . . . I want the input box to be populated dynamically.)
Kwitko
25 Mar 2004, 12:42am
You need a scripting language, something like perl or php, to pass the form's input.
a2jfreak
25 Mar 2004, 12:50am
Yahoo does it with the address book; compose an e-mail, then click on "To" and a window pops up. From there you can pick the address to send back to the original document. The original is never reloaded. It's done dynamically. I've looked at the source, but don't understand what all is going on. I was hoping someone could point me in the right direction.
kanezfan
25 Mar 2004, 1:11am
yahoo announced last year or so that they'd be using php from now on. if that's what they're using to do that, you'd never see it in the source because the scripting part is done by the server, you only get raw html on your end.
a2jfreak
25 Mar 2004, 3:19am
If it were done in PHP, though, first.html would be refreshed. It isn't. second.html closes and first.html's input text box is populated. I'm not saying PHP isn't used, but PHP isn't what causes this to work.
Straight_Man
25 Mar 2004, 4:19am
Well, you need code where the compose is a container, like a Sun Java jar, that has subroutines in it (.CLASS es, IE beans organized in sets). Fional output is document, in this case email. Browser only knows one page at a time, but can go BACK. So, you open new page, choose, and browser BACKs with choice in client's cut-n-paste buffer, then is pasted into the compose window. OR, server holds and pastes it after the Target=_Back action (not literal code for all browsers, is symbolic to show action, kinda a mini-pseudospec) in browser. How do you suppose I get back into an active edit session which stays open until I post or log off-- THIS one, I mean-- while being able to hop into threads to look things up, come back, type, look type, in one window???
THAT can be done remotely or by Java (or PHP, semistatic persistant session that does not quit on windows close, and temp session to choose address). Probably PHP call to Java applet, return result to compose routine as To filed entry... Could be a Java entry susystem, called by PHP, with the address picker a CLASS of function beans in same JAR as compose thing. Yahoo, like lots of majors, does use more than one language in sites.
Could also be data is a cookie push by chooser, and read by compose routine that chooser exits back to (chooser as subroutine or sepearate routine with cookie on client as data carrier-- address for email IS text....).
Or, they could do what Hotmail does, which is a melange of ASP+MSXML (aka aspx) with interlinked routines that pass vars back and forth. Some of those can be client side or server side activeX objects that behave somewhat like java miniapplets (Classes, in Java 2).
John D.
Kwitko
25 Mar 2004, 4:42am
Or you could just use PHP to pass the form variables. Here's a very simple proof of concept. I'm guessing you want something like this.
www.kwitko.net/form.php
//EDIT: Never mind. I got it backwards. You want to populate the input box with data from another page.
a2jfreak
25 Mar 2004, 5:56am
Thanks for the help.
I'll keep digging.
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.