PDA

View Full Version : Window popup + Click


Techno
04-21-2006, 02:27 PM
How is it possible to have a Window popup from a link, and on this window popup, to be able to send back to the caller of this popup window, some text?

so say for instance, we click on the "more" link on our smilies when you post a new thread/reply, when you click on "more" a Window pops up, then when you click on a smiley, it sends the textual equivelent back to the caller.

how can I do this?

Piperwolf
04-21-2006, 03:13 PM
I found examples for alert, confirm (okay, cancel) and prompt (what is your name); nothing of which that would allow the dialog box to allow form options. It appears that there should be something, just not in the limited books I have. I'll look online for it now, you should too, look for a popup dialog box.

Correction, I'm finding stuff under Modal Dialog boxes html

Techno
04-21-2006, 03:17 PM
Many thanks Piper and that is what I have been doing.

I have managed to create a popup (window.open()) and that works well.

I need to now be able to send messages back to the caller so I can do various things with the message returned back to the caller

Piperwolf
04-21-2006, 03:24 PM
Yah, there's the problem, opening up another window is easy enough, passing that information back to the other window becomes the problem. With a modal dialog box thats what its for, but there's not much information out there that fits what you want. Creating another window gets a little trickier passing information between them, but that may be the way to do it.

Piperwolf
04-21-2006, 03:28 PM
Okay, on that thought process, this is the way to do it, i think... When you open a window, give it a name, that's window.open(url,"nameofwindow").

In your main window, reference the new window by name
var firstname=nameofwindow.form1.fname.value;

The problem with this is that the user will have to fill out said form and not close it but go back to the main window and start an event that actually records that information.

Techno
04-21-2006, 03:57 PM
hmmm interesting.

Wonder how these guys here did it, and on other forums! :)

Techno
04-21-2006, 10:26 PM
I think I done it!!

Main Page: Set it a Window Name

Window popup javascript:



function DoSendTextBack(someText)
{
window.opener.FunctionName(someText);
window.focus();
}