title: FireFox Add-on: retrieve text from textbox in current tab gives no result
body: <p>I am trying to create an add-on that gets the contents (<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/textbox#a-textbox.value" rel="nofollow"><code>textbox.value</code></a>) from a textbox with ID = <code>city</code> from the current webpage and write it to a text file.  </p>
  
  <p>The file can be written without getting the textbox value. But, If I update the code then it writes nothing. Below is the code I used to get the textbox value.</p>
  
  <pre><code>var cityfromfield = window.content.document.getElementById('city').value;
  var date = new Date();
  var TimeStamp = date.toLocaleString();
  var wstrtotext = TimeStamp + cityfromfield;
  fos.write(wstrtotext, wstrtotext.length);
  </code></pre>
  
  <p>Any help would be appreciated.</p>