title: Pass form results to another form into a form value
body: <p>I have two forms on a page the "top form" searches for movies and I'm trying to get the data found from the top form and pass it as a value to the bottom form so it can get entered into a database.  </p>
  
  <p>I am unable to do this but, I can get the results to be displayed on the page. Here is my code:</p>
  
  <p><strong>TOP FORM DATA</strong></p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;?php
  $squery="";
  if(isset($_GET["squery"]))
  {
  $squery=$_GET["squery"];
  }
  ?&gt;
  &lt;div class="col-xs-8 col-xs-offset-2"&gt;
  &lt;form action="#" method="GET" class="form-horizontal"&gt;
  &lt;div class="form-group"&gt;
          &lt;label for="newMovieName" class="col-sm-3 control-label"&gt;Search what movie?&lt;/label&gt;
          &lt;div class="col-sm-9"&gt; &lt;input type="text" name="squery" class="form-control"&gt;&lt;br /&gt;
  &lt;input type="submit" value="Submit" class="btn btn-success"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/form&gt;
    &lt;script type="text/javascript" charset="utf-8"&gt;
      var api_key = '6969696969696969696969696969696';
  
      $(document).ready(function(){
        $.ajax({
          url: 'http://api.themoviedb.org/3/search/movie?api_key=' + api_key + '&amp;query=&lt;?php echo $squery; ?&gt;',
          dataType: 'jsonp',
          jsonpCallback: 'testing'
        }).error(function() {
          console.log('error')
        }).done(function(response) {
            var i=0;
         // for (var i = 0; i &lt; response.results.length; i++) {
            $('#search_results').append('&lt;li&gt;' + response.results[i].title + '&lt;/li&gt;');
         // }
           $('#search_results_title').append(response.results[i].title);
           $('#search_results_release').append(response.results[i].release_date);
           $('#search_results_overview').append(response.results[i].overview);
           $('#search_results_poster').append('https://image.tmdb.org/t/p/w185' + response.results[i].poster_path);
           $('#search_results_votes').append(response.results[i].vote_count);
        });
      });
    &lt;/script&gt;
  </code></pre>
  
  <p><strong>TOP FORM RESULTS</strong></p>
  
  <p>Here is where the results are displayed from the form above <strong>BUT</strong>, I would like these results to be displayed as a value in the form below.</p>
  
  <pre><code>  &lt;h3&gt;Results&lt;/h3&gt;
  
    &lt;p id="error"&gt;&lt;/p&gt;
    &lt;ul id="search_results_title"&gt;&lt;/ul&gt;
    &lt;ul id="search_results_release"&gt;&lt;/ul&gt;
    &lt;ul id="search_results_overview"&gt;&lt;/ul&gt;
    &lt;ul id="search_results_poster"&gt;&lt;/ul&gt;
    &lt;ul id="search_results_votes"&gt;&lt;/ul&gt;
  </code></pre>
  
  <p><strong>BOTTOM FORM DATA</strong></p>
  
  <p>Here is the bottom form that <strong>SHOULD</strong> get submitted to the database with the "Results" that are above as the value.</p>
  
  <pre><code>    &lt;form class="form-horizontal" role="form" action="processmovie.php" method="get" enctype="text/plain"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="newMovieName" class="col-sm-3 control-label"&gt;Title&lt;/label&gt;
      &lt;div class="col-sm-9"&gt;
        &lt;input type="text" class="form-control" id="newMovieName" name="movie_name" placeholder="Movie Title" required value=""&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="movieYear" class="col-sm-3 control-label"&gt;Year&lt;/label&gt;
      &lt;div class="col-sm-9"&gt;
        &lt;input type="text" class="form-control" id="movieYear" name="movie_year" placeholder="Year" required&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="movieBio" class="col-sm-3 control-label"&gt;Storyline&lt;/label&gt;
      &lt;div class="col-sm-9"&gt;
        &lt;textarea type="email" class="form-control" id="movieBio" name="movie_bio" rows="4" placeholder="Enter Storyline" required&gt;&lt;/textarea&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="newImage" class="col-sm-3 control-label"&gt;Movie Cover URL&lt;/label&gt;
      &lt;div class="col-sm-9"&gt;
        &lt;input type="text" id="newImage" class="form-control" name="movie_img" placeholder="Enter URL" required&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="movieRating" class="col-sm-3 control-label"&gt;Rating&lt;/label&gt;
      &lt;div class="col-sm-9"&gt;
        &lt;select id="movieRating" name="movie_rating" class="form-control" required&gt;
          &lt;option value="G"&gt;G&lt;/option&gt;
          &lt;option value="PG"&gt;PG&lt;/option&gt;
          &lt;option value="PG-13"&gt;PG-13&lt;/option&gt;
          &lt;option value="R"&gt;R&lt;/option&gt;
          &lt;option value="NR"&gt;NR (Not Rated)&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;div class="col-sm-offset-3 col-sm-9"&gt;
        &lt;button type="submit" class="btn btn-success"&gt;Add Movie&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I tried to use a variaty of code to try and get the value here is an example: <code>&lt;?php echo $_GET['search_results_title'];?&gt;</code></p>
  
  <p>I've also found examples like this: <a href="https://stackoverflow.com/questions/32241741/how-to-pass-the-value-of-a-form-to-another-form">How to pass the value of a form to another form?</a> but, my forms are on the same page and not different ones.</p>