title: JQueryMobile getting value of input field in a listview for searching in database
body: <p>I want to get the values of two listviews to use them as variables for a database-call. </p>
  
  <p>Here is a sscce:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt; 
   &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Startseite&lt;/title&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt;
  &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" /&gt; 
  &lt;script src="http://code.jquery.com/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $( document ).on( "pageinit", "#startseite", function() {
  /* retrieve text from clicked li */
  $(document).on("click", "li", function () {
    var text = $(this).text();
    $(this).closest("ul").prev("form").find("input").val(text);
    $(this).closest("ul").children().addClass('ui-screen-hidden');
  });
  
  $(document).on("click", "#send", function() {
  
  });
  });
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div data-role="page" id="startseite"&gt;
  
    &lt;div data-role="header" data-theme="a"&gt;
  &lt;h1&gt;Head&lt;/h1&gt;
    &lt;/div&gt;
  
    &lt;!--&lt;div data-role="main" class="ui-content"&gt;!--&gt;
    &lt;div data-role="tabs" id="tabs" &gt;
  &lt;div data-role="navbar" data-iconpos="left"&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="#one" data-ajax="false" class="ui-btn-active" data-icon="search"&gt;Suche&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#two" data-ajax="false" data-icon="location"&gt;Karte&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div id="one" class="ui-body-d ui-content"&gt;
    &lt;form&gt;
      &lt;label for="shop"&gt;Was suchen Sie?&lt;/label&gt;
      &lt;ul id="shop" data-role="listview" data-filter="true" data-filter-reveal="true" data-filter-placeholder="Restaurant, Bar, Kiosk" data-inset="true"&gt;
        &lt;li&gt;&lt;a href="#"&gt;Restaurant&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Bar&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Kiosk&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;label for="city"&gt;Wo suchen Sie?&lt;/label&gt;
      &lt;ul id="city" data-role="listview" data-filter="true" data-filter-reveal="true" data-filter-placeholder="Alsdorf" data-inset="true"&gt;
        &lt;li&gt;&lt;a href="#"&gt;Aachen&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Augsburg&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;br&gt;
      &lt;input id="send" class="ui-btn ui-btn-b ui-corner-all" type="button" value="Absenden"&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;div id="two" class="ui-body-d ui-content"&gt;
          Page 2
  &lt;/div&gt;
  </code></pre>
  
  <p>
      
      
      </p>
  
  <p>My problem is that I couldnt find a way to get access to the values of the from JQueryMobile generated input fields. </p>