title: Update an input value from giving data
body: <p>I am working on a project with openstreetmap, leaflet and the leaflet plugin search-leaflet. I have got a search form, where the user can autocomplete their adress and the location of the marker.</p>
  
  <p>The adress is then comma seperated in the input field and I want, if the user clicks on the button a second form should open, where the user can validate the adress. I guess, it is also better for storing the data in a database.</p>
  
  <p>My problem is, that i don't get the value of the autocomplete form, to store the value in the input text fields.</p>
  
  <p>Here my code:
  HTML</p>
  
  <pre><code>&lt;div class="col-md-8 col-md-offset-2 form-container"&gt;
  
  &lt;div id="map-adress"&gt;&lt;/div&gt;
  
  &lt;div class="panel panel-default marker-panel"&gt;
      &lt;div class="panel-heading"&gt;Create a post&lt;/div&gt;
      &lt;div class="panel-body"&gt;  
          &lt;div class="col-md-8 col-md-offset-4"&gt;
              &lt;p&gt;Insert the adress of the marker position&lt;br&gt;
                  (You can move the marker on the map to the right position).&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;label for="findbox-adress" class="col-md-4 control-label find-label"&gt;Marker Location&lt;/label&gt;
              &lt;div class="col-md-6"&gt;
                  &lt;div id="findbox-adress"&gt;&lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="col-md-2"&gt;
                  &lt;button type="submit" class="btn btn-primary user_marker_btn"&gt;
                      Validate
                  &lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div id="user_marker_adress" class="panel panel-default"&gt;
      &lt;div class="panel-heading"&gt;Validate the marker adress&lt;/div&gt;
      &lt;div class="panel-body"&gt;
  
          &lt;form class="form-horizontal" method="POST" action="{{ route('userposts.create') }}"&gt;
              {{ csrf_field() }}
  
              &lt;div class="form-group"&gt;
                  &lt;label for="a_street" class="col-md-4 control-label"&gt;Street&lt;/label&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;input id="a_street" type="text" class="form-control" name="a_street" required&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label for="a_street_no" class="col-md-4 control-label"&gt;Street No.&lt;/label&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;input id="a_street_no" type="text" class="form-control" name="a_street_no" required&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label for="a_zip_code" class="col-md-4 control-label"&gt;Zip Code&lt;/label&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;input id="a_zip_code" type="text" class="form-control" name="a_zip_code" required&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label for="a_state" class="col-md-4 control-label"&gt;State&lt;/label&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;input id="a_state" type="text" class="form-control" name="a_state" required&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label for="a_country" class="col-md-4 control-label"&gt;Country&lt;/label&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;input id="a_country" type="text" class="form-control" name="a_country" required&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;div class="col-md-8 col-md-offset-4"&gt;
                      &lt;button type="reset" class="btn btn-danger"&gt;
                          Clear
                      &lt;/button&gt;
                      &lt;button type="submit" class="btn btn-primary"&gt;
                          Next
                      &lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
          &lt;/form&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Javascript/jQuery</p>
  
  <pre><code>$(document).ready(function(){
  
  var map = new L.Map('map-adress', {zoom: 2, center: new L.latLng([24.61, -34.63]) });
  map.addLayer(new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      attribution: '&amp;copy; &lt;a href="http://www.openstreetmap.org/copyright"&gt;OpenStreetMap&lt;/a&gt;'
  }));
  
  
  /*var markersLayer = new L.LayerGroup();  //layer contain searched elements
  map.addLayer(markersLayer);
  */
  
  map.addControl( new L.Control.Search({
      container: 'findbox-adress',
      url: 'http://nominatim.openstreetmap.org/search?format=json&amp;q={s}',
      jsonpParam: 'json_callback',
      propertyName: 'display_name',
      propertyLoc: ['lat','lon'],
      marker: L.marker([0,0], {draggable:'true'}).addTo(map).on('click', getLatLon),
      autoCollapse: false,
      collapsed: false,
      autoType: false,
      minLength: 2,
      autoResize: false,
      zoom: 18
  }) );
  
  $( ".search-input" ).attr( "Placeholder", "No., Street, zip code, State and country" );
  
  function getLatLon(e) {
      alert(this.getLatLng());
  }
  
  $(".user_marker_btn").click(function(){
      $("#user_marker_adress").css( "display", "block" );
  });
  
  
  $(".user_marker_btn").click(function(){
      $(".search-input").change(function(){
          $(div).text($(this).val());
      });
  });
  
  });
  </code></pre>
  
  <p>If I click on the "user_marker_btn" the value of the "search-input" should change, that i can access the value. And store it in the second form and then store it into a database.</p>
  
  <p>But I don't know how? Hopefully someone can help me.</p>