Jump to content

[SOLVED] fast question about closing a window


M.O.S. Studios

Recommended Posts

it didn't work

 

this is my code

 

<html>
<head>
<script type="text/javascript">

function sendToPageOne()
{
    var thisValue = document.getElementById('image1').value;
    window.opener.form1.image1.value = thisValue;
}

</script>
</head>
<body>

<form name="form2" onsubmit="window.close()";>
<select name="image1" id="image1">
   <option value="one">One</option>
    <option value="Two">Two</option>
    <option value="Three">Three</option>
</select>
</form>

<input type="submit" onclick="sendToPageOne()"; value="Send to page 1">
</body>
</html>

 

it was opened with this code

 

       <br><a href="javascript:popUp('content/products/browse.php?name=image2')"><font size="1">Browse</font></a><input type="text" name="image2" value="" readonly>

Link to comment
Share on other sites

try

<html>
<head>
<script type="text/javascript">

function sendToPageOne()
{
    var thisValue = document.getElementById('image1').value;
    window.opener.form1.image1.value = thisValue;
    close();
}

</script>
</head>
<body>

<select name="image1" id="image1">
   <option value="one">One</option>
   <option value="Two">Two</option>
   <option value="Three">Three</option>
</select>
<input type="button" onclick="sendToPageOne()"; value="Send to page 1">
</body>
</html>

Link to comment
Share on other sites

looking at what you did that would probably work aswell,

 

how ever i just did this and it works perfectly

 

<html>
<head>
<script type="text/javascript">

function sendToPageOne()
{
    var thisValue = document.getElementById('<?php echo $_GET['name'] ?>').value;
    window.opener.form1.<?php echo $_GET['name'] ?>.value = thisValue;
}

</script>
</head>
<body>

<form name="form2" action="browse.php" method="POST">
<select name="<?php echo $_GET['name'] ?>" id="<?php echo $_GET['name'] ?>">
   <option value="one">One</option>
    <option value="Two">Two</option>
    <option value="Three">Three</option>
</select>
<input type="hidden" name="sent" value="1">
</form>

<input type="submit" onclick="sendToPageOne();self.close();"; value="Send to page 1">
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.