Я разработал одно текстовое поле ввода с кнопкой. Как только я нажимаю текстовое поле, он показывает одно всплывающее окно. Popup содержит таблицу со значениями. Теперь я выбрал одно значение, но оно не отображается в текстовом поле.Как отобразить всплывающее выбранное значение в текстовом поле
Как получить стоимость? Пожалуйста, направляйте меня.
<div>
<label for="name" style="margin: 0px;">EMP NAME</label>
<input type="text" class="input-normal" id="empname" href="#fee-details" data-toggle="modal" style="line-height: initial; margin-left: 6px;">
</div>
<div class="modal fade" id="fee-details" tabindex="-1" role="dialog" aria-labelledby="fee-details-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<table class="table table-condensed">
<thead class="modal-header login-modal-header">
<tr style="width:100%;">
<th style="width:50%;">Header1</th>
<th style="width:50%;">Header2</th>
</tr>
</thead>
<tbody class="body">
<tr>
<td>1</th>
<td class='val'>A</th>
</tr>
<tr>
<td>2</th>
<td class='val'>B</th>
</tr>
<tr>
<td>3</th>
<td class='val'>C</th>
</tr>
<tr>
<td>4</th>
<td class='val'>D</th>
</tr>
<tr>
<td>5</th>
<td class='val'>E</th>
</tr>
<tr>
<td>6</th>
<td class='val'>F</th>
</tr>
</tbody>
</table>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
$('.body').on('click',function(){
$('#empname').val($(this).find('.val').html());
$('#fee-details').modal('toggle');
});
Где код JS? –
Возможный дубликат [Twitter bootstrap: как отображать всплывающее значение в текстовом поле] (http://stackoverflow.com/questions/33102498/twitter-bootstrap-how-to-display-popup-value-in-text-box) – nameless
Duplicate вопрос. Пожалуйста, просмотрите http://stackoverflow.com/questions/33102498/twitter-bootstrap-how-to-display-popup-value-in-text-box –