Click to See Complete Forum and Search --> : Send var between windows & importing data


fredrikhw
03-31-2003, 03:48 AM
Hiya,

I'm making a page where people in an organization can send messages to each other. To avoid to much server-side and loading I'm trying to use javascript.

Problem 1
Users have to select who they want to send the message to. If they don't remember the name they can click a button which opens another window where they can select a name ("names that begin on A" and so forth), and it will be added in a multiple selection-list on the main page. How can I "send" this from the pop-up window to the main window without going server-side?

In a previous post by Dave Clark I found this: top.opener.document.formName.fieldName.value = str; How does this work?

Problem 2
The users can also send messages to a group of users. To do this I want them to be able to select the group in a selection-list, press a button, and javascript gets the users in that group and add them to the same multiple selection-list as above (hopefully without the main window going server-side). Can javascript get the users via jsp/servelet/struts? Or even applet or an text-file?

Thanks in advance! :)


Kind regards,
Fredrik H. Wisloeff

khalidali63
03-31-2003, 07:07 AM
Originally posted by fredrikhw
...top.opener.document.formName.fieldName.value = str; How does this work?
...Fredrik H. Wisloeff
You need to put the above line in your popup window,where form name is the name of the form in your parent window and fieldname is the field name in the parent window form.

[QUOTE]Originally posted by fredrikhw
[B]
Problem 2
...Can javascript get the users via jsp/servelet/struts? ....
[QUOTE]Originally posted by fredrikhw

The above depends on your design.

Offcoures javascript can get and pas values to java applet.

try this link.
http://68.145.35.86/skills/javascripts/applets/AppletJavaScriptInteraction.html

No javascript can not read text files.
And if I understand your question correctly,then you can not use javascript to send messages to other windows,unless and only when a parent window can send and recieve messages to and from children windows.

Cheers

Khalid

fredrikhw
04-01-2003, 04:49 AM
Thanks for your reply, but we've decided to try using jsp/struts before starting with applets.

Regards,
Fredrik