This is a shopping site I am making and what happens is the client chooses a style for the product they want to get. I have a standard page (the pop up) that they choose the style from then that value comes back to the parent page and then they add the item to there cart. Now I want to get this value taken from the pop up back to the proper form. I am very limited by the Web Host in what code I can use.
Also is there anyway to keep the parent page from refreshing to the top of the page? Any help is appreciated.
Thanks
Pop up windows code
Code:
[CODE]
<head>
<script language=”JavaScript” type=”text/javascript”>
function closeme(){
window.opener = null;
window.close();
}
</script>
</head>
<body>
<script language=”JavaScript”>
function getresult(){
for(i=0; i<26; i++)
{
if(document.forms[0].elements[i].checked)
{
var the_value = document.forms[0].elements[i].value;
}
}
self.opener.mainform.os0.value=the_value;
self.opener.mainform1.os0.value=the_value;
self.opener.mainform2.os0.value=the_value;
self.opener.mainform3.os0.value=the_value;
self.opener.mainform4.os0.value=the_value;
self.opener.mainform5.os0.value=the_value;
self.opener.mainform6.os0.value=the_value;
self.opener.mainform7.os0.value=the_value;
self.opener.mainform8.os0.value=the_value;
self.opener.mainform9.os0.value=the_value;
}
</script>
</head>
………………………..
<form>
blah blah blah
<input type=”button” name=”select” value=”Select” onclick=getresult()>
<input type=”button” name=”close” value=”Close” onclick=closeme()>
</form>
</body>
</html>
Parent Code Snippet
Code:
[CODE]
<div class=”container”>
<div align=”left”> <img src=”../items/princess_maiden_plate.jpg” width=”280″ height=”280″ alt=”” class=”welcome” align=”left”/> </div>
<div class=”iteminfo”>
<p class=”itemname”>Size: <span class=”itemname1″>7 1/2″ Plate</span></p>
<p class=”features”> </p>
<ul>
<li></li>
</ul>
</p>
<p class=”price”>Price: <span class=”sale”>$15.00</span></p>
<form>
<input type=”image” src=”../images/style.gif” name=”style” onclick=”windowopener()” border=”0″ width=”120″ height=”23″ />
</form>
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post” name=”mainform” target=”paypal” id=”mainform”>
<input type=”hidden” name=”cmd” value=”_cart” />
<input type=”hidden” name=”business” value=”email addy” />
<input type=”hidden” name=”item_name” value=”7 1/2 Inch Plate” />
<input type=”hidden” name=”amount” value=”15.00″ />
<input type=”hidden” name=”currency_code” value=”CAD” />
<input type=”hidden” name=”lc” value=”CA” />
<input type=”hidden” name=”on0″ value=”Pattern” />
<input type=”hidden” name=”os0″ />
<input type=”image” src=”https://www.paypal.com/en_US/i/btn/x-click-but22.gif” border=”0″ name=”submit” alt=”” width=”87″ height=”23″ />
<input type=”hidden” name=”add” value=”1″ />
</form>
</div>
</div>
<br />
<div class=”container”>
<div align=”left”> <img src=”../items/native_couple_plate.jpg” width=”280″ height=”280″ alt=”” class=”welcome” align=”left”/> </div>
<div class=”iteminfo”>
<p class=”itemname”>Size: <span class=”itemname1″>10 1/2″ Plate</span></p>
<p class=”features”> </p>
<ul>
<li></li>
<li></li>
</ul>
</p>
<p class=”price”>Price: <span class=”sale”>$25.00</span></p>
<form>
<input type=”image” src=”../images/style.gif” name=”style” onclick=”windowopener()” border=”0″ width=”120″ height=”23″ />
</form>
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post” name=”mainform1″ target=”paypal” id=”mainform1″>
<input type=”hidden” name=”cmd” value=”_cart” />
<input type=”hidden” name=”business” value=”email addy” />
<input type=”hidden” name=”item_name” value=”10 1/2 Inch Plate” />
<input type=”hidden” name=”amount” value=”25.00″ />
<input type=”hidden” name=”currency_code” value=”CAD” />
<input type=”hidden” name=”lc” value=”CA” />
<input type=”hidden” name=”on0″ value=”Pattern” />
<input type=”hidden” name=”os0″ />
<input type=”image” src=”https://www.paypal.com/en_US/i/btn/x-click-but22.gif” border=”0″ name=”submit” alt=”” width=”87″ height=”23″ />
<input type=”hidden” name=”add” value=”1″ />
</form>
</div>
Again thank you,
Midknight