Click to See Complete Forum and Search --> : Pop-up Window
piglet
09-14-2003, 07:18 AM
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.
zachzach
09-15-2003, 03:09 PM
|||||||||||||||||||||||||||||||||||||||
page_1:
|||||||||||||||||||||||||||||||||||||||
<html>
<head>
</head>
<body>
<script>
function onclick1() {
basewin = window.self
newwin = window.open("page_2.html")
}
</script>
<form name=form1>
<input type="text" name=text1>
<input type=button onclick="onclick1()">
</form>
</body>
</html>
|||||||||||||||||||||||||||||||||||||||
page_2:
|||||||||||||||||||||||||||||||||||||||
<html>
<head>
</head>
<body>
<script>
function onselect(valueA, itemname) {
var remeber = valueA
itemname.BackroundColor="orange"
}
function onclick2() {
basewin.document.form1.text1=remember
}
</script>
<center>
<div id=divA>
blah blah blah blah blah blah blah blah desciption of the product blah blah blah blah<br>
<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')"
</div>
<div id=divB>
blah blah blah blah blah blah blah blah desciption of the product blah blah blah blah<br>
<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')"
</div>
<br>
<input type=button value="whatever put stuffffffs here" onclick="onclick2()">
</body>
</html>
hope that helps,
zach
zachzach
09-15-2003, 03:10 PM
oooooops
change the script on page_2 to:
<script>
function onselect(valueA, itemname) {
var remeber = valueA
itemname.BackroundColor="orange"
}
function onclick2() {
basewin.document.form1.text1=remember
window.close()
}
</script>
zach