I have this dropdown
but I don't know how to make it so that when I select any it prints directly on it input
.
I don't do it with select because the dropdown is like a mini search engine
This is my input code with thedropdown
<div class="input-group">
<input type="text"
class="form-control"
name="codigoOrdenTrabajo"
style="width: 65px"
minlength="5"
maxlength="5">
<div class="input-group-append">
<button type="button"
class="btn btn-default btn-sm dropdown-toggle"
data-toggle="dropdown"
aria-expanded="false">
</button>
<div class="dropdown-menu dropdown-menu-right">
<?php
$item = null;
$valor = null;
$orden = ControladorOrdenTrabajo::ctrMostrarOrdenTrabajo($item, $valor);
foreach ($orden as $value) {
echo '<a class="dropdown-item"
href="#">' . $value["codigoOrdenTrabajo"] . '</a>';
}
?>
</div>
</div>
</div>
What you can do is that when doing
click
on any of thea
deldropdown
a function is triggered, which takes the value of thea
clicked and puts it in thevalue
del<input/>
Example: