brandoncluff brandoncluff - 7 months ago 32
HTML Question

Bootstrap Dropdown in Table Detail

What is the right way to add a dropdown? I'm passing this info to a JS/PHP and everything else is working... I am hoping to change as little as possible!

<table id="create">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Start</th>
<th>End</th>
<th>Active</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><input style="min-width: 180px" class="form-control name" type="text" name="name" placeholder="Contest Name"></td>
<td> BOOTSTRAP DROPDOWN </td>
<td><input class="form-control start" type="date" name="start" placeholder="Start Date (mm/dd/yyyy)"></td>
<td><input class="form-control end" type="date" name="end" placeholder="End Date (mm/dd/yyyy)"></td>
<td><input class="form-control active" type="checkbox" name="active" value="1" CHECKED></td>
<td><input class="btn btn-success create" type="button" name="create" value="Create"></td>
</tr>
</tbody>
</table>


Thank you!

Answer

Unless I am missing something this is pretty straight forward since the documentation is found here. Just scroll down to the select section to read about it. Add this code in your form.

<select class="form-control">
  <option>1</option>
  <option>2</option>
  <option>3</option>
  <option>4</option>
  <option>5</option>
</select>