/    Sign up×
Community /Pin to ProfileBookmark

Pop-up Window

Hi

I need this:
A page (page_1) with a button on it. By clicking the button it must open a new small window (page_2). On page_2 you can select products and by highlighting the product and by clicking on a button it must take the value back to page_1 and display in it’s own textfield and page_2 window must close. You must be able to repeat the process for as many times you like.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@zachzachSep 15.2003 — |||||||||||||||||||||||||||||||||||||||

page_1:

|||||||||||||||||||||||||||||||||||||||

<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;script&gt;
function onclick1() {
basewin = window.self
newwin = window.open("page_2.html")
}
&lt;/script&gt;


&lt;form name=form1&gt;
&lt;input type="text" name=text1&gt;
&lt;input type=button onclick="onclick1()"&gt;
&lt;/form&gt;


&lt;/body&gt;
&lt;/html&gt;




|||||||||||||||||||||||||||||||||||||||

page_2:

|||||||||||||||||||||||||||||||||||||||

<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;script&gt;
function onselect(valueA, itemname) {
var remeber = valueA
itemname.BackroundColor="orange"
}
function onclick2() {
basewin.document.form1.text1=remember
}
&lt;/script&gt;

&lt;center&gt;

&lt;div id=divA&gt;
blah blah blah blah blah blah blah blah desciption of the product blah blah blah blah&lt;br&gt;
&lt;input type=button value="buy this product/whatever put stufffffs here" onclick="onselect('what you want the textbox on page_1 to say goes here', 'divA')"
&lt;/div&gt;


&lt;div id=divB&gt;
blah blah blah blah blah blah blah blah desciption of the product blah blah blah blah&lt;br&gt;
&lt;input type=button value="buy this product/whatever put stufffffs here" onclick="onselect('what you want the textbox on page_1 to say goes here', 'divB')"
&lt;/div&gt;

&lt;br&gt;

&lt;input type=button value="whatever put stuffffffs here" onclick="onclick2()"&gt;

&lt;/body&gt;
&lt;/html&gt;





hope that helps,

zach
Copy linkTweet thisAlerts:
@zachzachSep 15.2003 — oooooops

change the script on page_2 to:

<i>
</i>&lt;script&gt;
function onselect(valueA, itemname) {
var remeber = valueA
itemname.BackroundColor="orange"
}
function onclick2() {
basewin.document.form1.text1=remember
window.close()
}
&lt;/script&gt;


zach
×

Success!

Help @piglet 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.14,
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,
)...