title: How to send a selected value of an option to a PHP function as a argument
body: <p>I want to send the value of selected index to a function, where all option values are coming through database.</p>
  
  <pre><code>&lt;select onchange="get_api_key();" name="service"&gt;
      &lt;option value=""&gt;Select your Service&lt;/option&gt;
      &lt;optgroup label="Apple Iphone"&gt;
          &lt;option value="53"&gt;Apple &lt;/option&gt;
          &lt;option value="72"&gt;Ipad &lt;/option&gt;
          &lt;option value="77"&gt;iPhone&lt;/option&gt;
          &lt;option value="24"&gt;Iphone&lt;/option&gt;
      &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>