title: Uncaught TypeError: Cannot set property 'value' of undefined in Google Chrome
body: <p>In my page A, there is a textarea defined like this:</p>
  
  <pre><code>&lt;textarea readonly wrap="Physical" cols="50" rows="2" name="Attr"&gt;
  </code></pre>
  
  <p>The page A opens page B in a popup (by <code>window.open('PageB')</code>).</p>
  
  <p>In the page B, the button "Save" executes this line of code:</p>
  
  <pre><code>window.parent.opener.document.all.Attr.value='Value 1, Value 2,';
  </code></pre>
  
  <p>This one causes an error in Google Chrome (error: "Uncaught TypeError: Cannot set property 'value' of undefined") but works perfectly with Internet Explorer and Mozilla Firefox. I have read that <code>document.all</code> is old and should be replaced by <code>document.getElementById</code> which I did but with no success (error: "Uncaught TypeError: Cannot set property 'value' of null").</p>
  
  <p>If I replace <code>document.all</code> by <code>document.forms[0]</code>, it works in all browsers including Google Chrome. But that doesn't seem to be a good solution as the page B could be called by other pages than Page A and that could have more than one form.</p>
  
  <p>Could anyone tell me what I am doing wrong?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Opec.</p>