title: Reload Parent window Javascript originated
body: <p>So i have a form echo'ed in my PHP:</p>
  
  <pre><code>echo "&lt;td class='btn'&gt;&lt;a href=\"/php/editPs/unlinkWhere.php?product=".$row['item_id']."\"  onclick=\"goclicky(this); return false;\"  target=\"_blank\"&gt;&lt;img src=\"img/unlink.png\" border=\"0\"&gt;&lt;/a&gt;&lt;/td&gt;";
  </code></pre>
  
  <p>This is the JS funcion that it calls:</p>
  
  <pre><code>function goclicky(meh)
  {
  var x = screen.width/2 - 400/2;
  var y = screen.height/2 - 300/2;
  window.open(meh.href, 'Unlink','height=300,width=400,left='+x+',top='+y);
  }
  </code></pre>
  
  <p>Then the page unlinkWhere.php loads in the middle of the screen and inside there is another form:</p>
  
  <pre><code>echo "&lt;form action=\"/php/editPs/unlink.php\" onSubmit=\"return valida(); \" method=\"post\" &gt;";
  </code></pre>
  
  <p>That submit's all data closes the popup and here is my problem, i cant figure out how to refresh/reload the previous page:</p>
  
  <pre><code>//if its validated then
  if((valLOC!=0 &amp;&amp; valTEA==0 &amp;&amp; valPERSONFIELD==0)||(valLOC==0 &amp;&amp; valLOCDES=='' &amp;&amp; valTEA!=0 )){
              //hide error div
      erro.style.display='none';
  
  
              //DOES NOT WORK
      window.opener.document.location.reload(true);
  
  
      window.close();
      return true;
  
      } else{
          erro.style.display='inline';
          return false;
          }   
  </code></pre>
  
  <p>I think my problem is that i am generating the href link through js and the parent is not working... any ideias how can i do this?</p>