title: How to use JavaScript to fill a form on another page
body: <p>I am trying to fill out the fields on a form through JavaScript.  The problem is I only know how to execute JavaScript on the current page so I cannot redirect to the form and execute code from there.  I'm hesitant to use this term, but the only phrase that comes to mind is cross-site script.  The code I am attempting to execute is below.</p>
  
  <pre><code>&lt;script language="javascript"&gt; 
  
  window.location = "http://www.pagewithaform.com";
  
  loaded();
  
  //checks to see if page is loaded. if not, checks after timeout.
  function loaded()
  {
      if(window.onLoad)
      {
        //never executes on new page. the problem
        setTitle();
      }
      else
      {
        setTimeout("loaded()",1000);
        alert("new alert");
      }
  }
  
  //sets field's value
  function setTitle()
  {
      var title = prompt("Field Info","Default Value");
      var form = document.form[0];
      form.elements["fieldName"].value = title;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm not truly sure if this is possible.  I'm also open to other ideas, such as PHP.  Thanks.</p>
  
  <p>EDIT: The second page is a SharePoint form.  I cannot edit any of the code on the form.  The goal is to write a script that pre-fills most of the fields because 90% of them are static.</p>