title: How to get value from popup window to parent window by clicking from database selection?
body: <p>I need advice on how to get the selected value from the popup window to the parent window by clicking on the database selection.
  my parental window is as follows:</p>
  
  <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt;
  var retVal=""
  var valReturned;
  function openModal() {
      retVal = window.open("stranky/modal.php", "_blank", "width=950,height=600");
      valReturned=retVal;
      document.getElementById("zakaznik").value=valReturned;
      //alert('The following text has been returned: "'+valReturned+'"');
  }
  </code></pre>
  
  <p></p>
  
  <pre><code>                &lt;tr&gt;
                      &lt;td&gt;Zákazník:&lt;/td&gt;
                      &lt;td&gt;&lt;input id="zakaznik" type="text" name="zakaznik" value=""&gt;&amp;nbsp;&lt;input class="odeslat" type="button" name="vybrat" value="Vybrat" onclick="openModal()"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  </code></pre>
  
  <hr>
  
  <p>in popup window (modal.php) I have this:</p>
  
  <pre><code>&lt;td&gt;&lt;a href="#" onclick="returnValue='.$data["id"].';window.close();"&gt;'.$data["id"].'&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>window will open to me normally, I can click on the selected value from the database - after clicking on the selected field will close the window, but the form field zakaznik in the parent window does not get the value, only when opening the popup window will form [object Window] zakaznik. I think I miss something, and I think it's wrong. could someone advise what it should look like?
  Thank you.</p>