Level 8
Try this
$('#dynamic-row').html(res);
Instead of
$('#dynamic-row').empty();
$('#dynamic-row').append(res);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a live search and am trying to append the results to the table using a Laravel partial blade but it's not rendering at all. All ideas are welcome.
js
$('body').on('keyup','#search-patients',function()
{
var keyword = $(this).val();
$.ajax({
type: "POST",
url: "{{ route('searchPatients')}}",
dataType: "json",
data: {keyword: keyword,
_token: '{{csrf_token()}}'
},
success: function(res){
$('#dynamic-row').empty();
$('#dynamic-row').append(res);
}
});
});
```
partial blade
@foreach ($patient_admissions as $patient_admission)
table
<tbody id="dynamic-row" style="font-size:13px; vertical-align:middle">
</tbody>
Please or to participate in this conversation.