/    Sign up×
Community /Pin to ProfileBookmark

interacting between 2 windows using js

I’m a little bit of a newbie when it comes to Javascript but it is often the easiest way to do things.

Anyways I’m looking for a way to interact a text field in one window with a click in another window.

The only real clue I’m lacking is how to give the two pages different names.

i.e. instead of document.textfield1.text.whatever
have something like mydocument.textfield1.text.whatever

Thanks for the help!
It is becoming very time consuming to find a solution as it isn’t in basic tutorials and I can’t find the time to go through more complete tutorials.

Jeff

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayJan 29.2004 — You can do it with the window.open(URL, "myDocument", Params) command or by issuing window.name="myDocument" after the window is open.
Copy linkTweet thisAlerts:
@g1nger_oneauthorJan 29.2004 — Right, typical it didn't work first time.

Just tell me if this looks right.

I have a page with a link on it:
<A HREF="/gykd/picbin/small/pictureviewer.html" target="_blank"><IMG SRC="/gykd/picbin/system/help.gif" BORDER="0" onClick="window.name='mydocument' "></A>[/QUOTE]
So when the user clicks on the link it renames the current page and opens the new page.

On the new page it has an image that the user clicks on, to select that image. What I want to happen is that on the click it changes the text in a text box on the other page.
<A HREF="javascript:void(0)"><IMG SRC=%s%s BORDER="0" onClick="mydocument.userform.image.value = '%s' "></A>[/QUOTE]

Does this look like it should work?
Copy linkTweet thisAlerts:
@g1nger_oneauthorJan 30.2004 — Any help would be really apriciated!

Either, the name is not being changed with the first link, or more likely my call to the text box value is not correct.

How would I get hold of a text box in another window that would normally be got (if in the same window) by:

document.userform.image.value

It seems like a simple bit of information but it is becoming very hard to find out.
Copy linkTweet thisAlerts:
@TheBearMayJan 30.2004 — If the value is in the window that opened the current window try something like:

onclick="window.opener.userform.image.value ='New Value';"
Copy linkTweet thisAlerts:
@g1nger_oneauthorFeb 02.2004 — Thanks that worked a treat!

Much apriciated!
×

Success!

Help @g1nger_one spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...