title: parent child forms and passing values
body: <p>I have the following as parent and child</p>
  
  <p>Parent (just posting the script and the form tags)</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  window.onload = function () {
      document.getElementById('NewTicket').onsubmit = sendToChild;
      document.getElementById('sName').onclick = openChild;
  }
  function openChild() {
      this.disabled = true;
      xWinOpen('SecList.asp');
      this.disabled = false;
  }
  function sendToChild() {
      if (xChildWindow) {
          var pta = document.getElementById('sName');
          var cta = xChildWindow.document.getElementById('sName');
          cta.value = pta.value;
          xChildWindow.focus();
      }
      return false;
  }
  var xChildWindow = null;
  function xWinOpen(sUrl) {
      // Modify 'features' to suit your needs:
      var features = "left=100,top=100,width=400,height=400,location=0,menubar=0," +
      "resizable=1,scrollbars=1,status=0,toolbar=0";
      if (xChildWindow &amp;&amp; !xChildWindow.closed) { xChildWindow.location.href = sUrl; }
      else { xChildWindow = window.open(sUrl, "myWinName", features); }
      xChildWindow.focus();
      return false;
  }&lt;/script&gt;&lt;form name="NewTicket" target="_self" method="POST" action=""&gt;&lt;input name="sName" type="text" value="ABC" id="sName"&gt;&lt;/form&gt;
  </code></pre>
  
  <p>The Child looks like this (once again only the script and the tbody part).</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
      function sendToParent(myStr)
      {
            alert(myStr)
            var myStrSplit = myStr.split("/")
            opener.document.NewTicket.sID.value = myStrSplit[0]
            opener.document.NewTicket.sName.value = myStrSplit[1]
            document.write(myStrSplit[0])
            document.write(myStrSplit[1])
            self.close();
      }
      &lt;/script&gt;
  &lt;tbody&gt;
              &lt;%Do While Not oRS.EOF
                sVal = oRS("sID") &amp; "/" &amp; oRS("SecDet")%&gt;
              &lt;tr&gt; 
                  &lt;td&gt;&lt;%=oRS("sID")%&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;a href="#" onclick="sendToParent(" &amp; &lt;%=sVal%&gt; &amp; ")"&gt;&lt;%=oRS("SecurityName")%&gt;&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=oRS("BBG_Ticker")%&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=oRS("ISIN_Code")%&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=oRS("Country")%&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=oRS("Curr")%&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;%oRS.MoveNext
          Loop%&gt;
          &lt;/tbody&gt;
  </code></pre>
  
  <p>in the child oRs("SecDet") is 5 fields concatenated with "/" which i am doing a split in the function.</p>
  
  <p>What i wish to do?
   as you can see in the child form there will be a table and I want that when the user clicks on any row all the corresponding 6 fields on that row should populate to the 6 text fields in the parent.</p>
  
  <p>what i am unable to achieve?
  seems sendToParent() does not work at all.</p>
  
  <p>appreciate your help.</p>