title: How to get and send values from html <textarea> to a PHP page?
body: <p>I created a form for image uploading. This form also includes a  tag to add information about the image being uploaded. I need the text from the  tag to be sent over to a page &quot;savetofile.php&quot; whenever 'Upload' button is clicked.</p>
  <p>Currently the picture uploading works, the picture information is sent correctly, but I can't get the text from the  tag on the &quot;savetofile.php&quot; page.</p>
  <p>Form</p>
  <pre><code>&lt;form action=&quot;savetofile.php&quot; enctype=&quot;multipart/form-data&quot; id=&quot;form1&quot; method=&quot;post&quot;&gt;
  
      &lt;div&gt;
          &lt;label for=&quot;fileToUpload&quot;&gt;Take or select photo(s)&lt;/label&gt;&lt;br/&gt;
          &lt;input accept=&quot;image/*&quot; capture id=&quot;fileToUpload&quot; name=&quot;fileToUpload&quot; onchange=&quot;fileSelected();&quot;
                 type=&quot;file&quot;/&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
          &lt;br&gt;&lt;br&gt;
          &lt;label for=&quot;notes&quot;&gt;Notes:&lt;/label&gt;
          &lt;textarea cols=&quot;50&quot; id=&quot;notes&quot; maxlength=&quot;2000&quot; name=&quot;notes&quot; placeholder=&quot;Please enter any additional information here&quot;
                    rows=&quot;4&quot; onchange=&quot;this.form.submit()&quot;&gt;&lt;/textarea&gt;
          &lt;br&gt;&lt;br&gt;
      &lt;/div&gt;
  
      &lt;div id=&quot;details&quot;&gt;&lt;/div&gt;
  
      &lt;div&gt;
          &lt;input onclick=&quot;uploadFile()&quot; type=&quot;button&quot; value=&quot;Upload&quot;/&gt;
      &lt;/div&gt;
  
      &lt;div id=&quot;progress&quot;&gt;&lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  <p>savetofile.php</p>
  <pre><code>$text = $_POST['notes'];
  _log('text: ' .$text);
  </code></pre>
  <p>uploadFile()</p>
  <pre><code>        function uploadFile() {
              var fd = new FormData();
              var count = document.getElementById('fileToUpload').files.length;
  
              for (var index = 0; index &lt; count; index++) {
                  var file = document.getElementById('fileToUpload').files[index];
                  fd.append('myFile', file);
              }
  
              var xhr = new XMLHttpRequest();
  
              xhr.upload.addEventListener(&quot;progress&quot;, uploadProgress, false);
              xhr.addEventListener(&quot;load&quot;, uploadComplete, false);
              xhr.addEventListener(&quot;error&quot;, uploadFailed, false);
              xhr.addEventListener(&quot;abort&quot;, uploadCanceled, false);
              xhr.open(&quot;POST&quot;, &quot;savetofile.php&quot;);
              xhr.send(fd);
          }
  </code></pre>
  <p>Current output:</p>
  <pre><code>Undefined index: notes...
  text: 
  </code></pre>