0

I have this inside a form:

<div class="dropdown">
  <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
  <span class="caret"></span></button>
  <ul class="dropdown-menu">
    <li><a href="#">HTML</a></li>
    <li><a href="#">CSS</a></li>
    <li><a href="#">JavaScript</a></li>
  </ul>
</div>

when it submits how I get the value of the selected choice in php?I have the other fields but I don't know how to get this one.Thanks

Sredny M Casanova
  • 4,735
  • 21
  • 70
  • 115
  • 1
    Maybe this is useful to you: https://silviomoreto.github.io/bootstrap-select/ and this: http://stackoverflow.com/questions/18150954/how-can-i-render-a-list-select-box-dropdown-with-bootstrap – Kostas Mitsarakis Oct 22 '15 at 00:02
  • But i think that what you really need is in @cmcculloh answer right here: http://stackoverflow.com/questions/13437446/how-to-display-selected-item-in-bootstrap-button-dropdown-title – Kostas Mitsarakis Oct 22 '15 at 00:10
  • that's what I need! thank you very much! – Sredny M Casanova Oct 22 '15 at 12:14

1 Answers1

0

A drop down list in a <form> tag uses the <select> tag along with a set of <option> tags each with a different value parameter. Your form will also need an <input type="submit">. The following is an example of a properly constructed drop down list form.

<form>
  <select name="lang">
    <option value="html">html</option>
    <option value="css">CSS</option>
    <option value="javascript">JavaScript</option>
    <option value="php">PHP</option>
  </select>
  <br />
  <input type="submit">
</form>
Joshua Cook
  • 12,495
  • 2
  • 35
  • 31