title: How to send a list item value in a form with get or post request?
body: <p>I want to submit list value using form, what is the proper way??<br>
  I have a list which is dynamically generated this is only a static list.
  So how do I send a particular list value which is clicked ?
  It can be accomplished by using separate name for each list,but i do not want to do that as my list is dynamically generated and I have to catch its value from a number of list items.   There is a solution for a similar type of problem for dropdown list. link-<a href="https://stackoverflow.com/questions/11944120/php-request-the-values-of-a-html-form-drop-down-list">PHP: Request the values of a HTML form drop down list</a>   </p>
  
  <pre><code>&lt;form action="" id="form-id" method="get"&gt;
  &lt;ol name="test"&gt;
  &lt;a href="#" onclick="document.getElementById('form-id').submit();"&gt;
  &lt;li&gt;
  &lt;input type="hidden"  value="testvalue"&gt;  //list value 1 
  Coffee
  &lt;/li&gt;
  &lt;/a&gt;
  &lt;a href="#" onclick="document.getElementById('form-id').submit();"&gt;
  &lt;li&gt;
  &lt;input type="hidden"  value="testvalue1"&gt;  //list value 2
  Tea
  &lt;/li&gt;
  &lt;/a&gt;
  &lt;/ol&gt;
  &lt;/form&gt;
  
  &lt;?php
   if(isset($_GET['test']))
   echo $_GET['test'];
  ?&gt;
  </code></pre>