Forum Moderators: open
Using a script fragment I found, I came up with the following:
Now my questions are:
How can I return the selected colour-image back to the "main page", as well as the selected value, so the selected colour-image can be shown as a reminder, somewhere near the form?
There are some more aspects of the form that I need help with (on the page), but just getting the image to return as well as the value would be a great start!
Thanks in advance!
[edited by: jatar_k at 8:39 pm (utc) on July 20, 2005]
[edit reason] no urls thanks [/edit]
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<script>
var _v = "<html><head><"+"script>";
_v += "function passBack(_a){opener.catchIt(_a);self.close();}";
_v += "<"+"/script></head><body>";
_v += "<a href=\"#\" onclick=passBack('123T')><img src=\"images/colour1.jpg\" alt=\"blonde\" height=\"100\" width=\"85\" border=\"0\"></a><br>";
_v += "<a href=\"#\" onclick=passBack('637T')><img src=\"images/colour2.jpg\" alt=\"brunette\" height=\"100\" width=\"85\" border=\"0\"></a><br>";
_v += "</body></html>";
var newWin=null;
function doIt()
{
newWin=window.open("","","width=500,height=300,top=100,left=100");
newWin.document.open();
newWin.document.write(_v);
newWin.document.close();
}
function catchIt(_z)
{
if (document.all)
{
document.all.one.innerHTML=_z;
document.all.two.innerHTML="Choose again?";
}
document.justforshow.data.value=_z; /* just for show */
}
</script>
<link href="styles/style01.css" type="text/css" rel="stylesheet" media="screen">
<title>Popup Selection Passing Back To Form</title>
</head>
<body>
<table class="maintext" width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><br>
<br>
<span class="TextEmphasis">Popup Selection Passing Back To Form</span><br>
<br>
<br>
<br>
<table class="maintext" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a id="two" onclick="doIt()" href="#">Choose colour</a></td>
<td align="center">
<div align="center">
<img src="images/singtranspixel.gif" alt="" height="15" width="50" border="0"></div>
</td>
<td><a id="one">COLOUR</a></td>
</tr>
</table>
<br>
<form name="justforshow">
Selected Value: <input type="text" name="data" value="(choose colour to display)" readonly>
</form>
</td>
</tr>
<tr>
<td><br>
</td>
</tr>
</table>
<p></p>
</body>
</html>
You can make hidden fields or non-editable text fields in the form and when you finalize the window it sets the values for them.
Another [webmasterworld.com]
Full Google results from WW [google.com]
(Use the advanced search on Google, select only this doamin, enter webmasterworld.com)