title: submitting a text search using jsoup
body: <p>I have a piece of html code which represents a part of a website that is supposed to be the search widget for a directory of a faculty in a university </p>
  
  <pre><code> &lt;div id="right_column" class="content_main"&gt; 
      &lt;div class="searchbox"&gt; 
       &lt;form method="POST" action="/faculty/directory_search/" id="searchform"&gt; 
        &lt;h4&gt;Search the Directory&lt;/h4&gt; 
        &lt;input type="text" name="searchterms" value="" /&gt; 
        &lt;select name="category" class="dropdown"&gt; &lt;option value="all" selected="selected"&gt;All Categories&lt;/option&gt; &lt;option value="Faculty"&gt;Faculty&lt;/option&gt; &lt;option value="Staff"&gt;Staff&lt;/option&gt; &lt;option value="Visitors"&gt;Visitors&lt;/option&gt; &lt;option value="Full time"&gt;Full time&lt;/option&gt; &lt;option value="Visiting"&gt;Visiting&lt;/option&gt; &lt;option value="Special Appointment"&gt;Special Appointment&lt;/option&gt; &lt;option value="Biological Sciences"&gt;Biological Sciences&lt;/option&gt; &lt;/select&gt; 
        &lt;input type="hidden" name="sort" value="asc" /&gt; 
        &lt;input type="submit" class="submit" value="Search directory" /&gt; 
        &lt;a class="button" href="/faculty/index/desc" id="sortbutton"&gt;Sort Alphabetically&lt;/a&gt; 
       &lt;/form&gt; 
       &lt;script type="text/javascript"&gt;
                  $('#searchform').ready(function(){
                      $('#sortbutton').click(function(){
                          $('input[name="sort"]').val('desc');
                          $('#searchform').submit();
                          return false;
                      });
                  });
              &lt;/script&gt; 
      &lt;/div&gt; 
  </code></pre>
  
  <p>I am trying to input the name "john" and submit the search using jsoup using the following java code (intended for android but it's overall the same java code as for a regular java app)</p>
  
  <pre><code>Document doc = Jsoup.connect("http://www.qatar.cmu.edu/directory/").data("searchterms", "john").post();
  </code></pre>
  
  <p>However, I keep getting the same page as just "<a href="http://www.qatar.cmu.edu/directory/" rel="nofollow">http://www.qatar.cmu.edu/directory/</a>" with no search submitted. I noticed that in the html code there is the submit input type. I'm wondering if I had to submit the search. If so, how can it be done?</p>