title: Javascript Error in Child Window
body: <p>I am trying to figure out why I am getting the error: </p>
  
  <p><code>"window.opener.document.aspnetForm.formType is null or not an object".</code> </p>
  
  <p>I am passing a value from the parent window through a URL string to a popup window (this child window is a search form).
  This value is an ID of a SharePoint form field (there is a reason I need to do it this way, the value indicates whether it is from the newform or editform).
  I am declaring the variable formType from the value obtained in the url string using a function in the child window (geturlvalue()),</p>
  
  <p><code>var formType = geturlvalue(name);</code> </p>
  
  <p>The variable "formType" is working in the child window fine, alerting it prior to the window opener shows the correct value from the parent window which is 
      <code>ctl00_m_g_004d943c_bb99_4fba_bee5_68862443b98d_ctl00_ctl04_ctl18_ctl00_ctl00_ctl04_ctl00_ctl00_TextField</code></p>
  
  <p>here is the opener in the child window:</p>
  
  <pre><code>window.opener.document.aspnetForm.formType.value = document.getElementById('Server').value;
  </code></pre>
  
  <p>the opener needs to populate an input field in the parent window from a value in the child window field with an ID of Server.</p>
  
  <p>anyone have any idea as to why I am getting the error on formType? If I add <code>ctl00_m_g_004d943c_bb99_4fba_bee5_68862443b98d_ctl00_ctl04_ctl18_ctl00_ctl00_ctl04_ctl00_ctl00_TextField</code> to the opener in place of formType it works as it should and populates the parent input field:</p>
  
  <p>window.opener.document.aspnetForm.ctl00_m_g_004d943c_bb99_4fba_bee5_68862443b98d_ctl00_ctl04_ctl18_ctl00_ctl00_ctl04_ctl00_ctl00_TextField.value = document.getElementById('Server').value;</p>