Jeg er ikke sikker

This commit is contained in:
victor 2020-07-28 11:07:33 +02:00
parent 8cfca540f4
commit c9cb3e99cd
2 changed files with 13 additions and 1 deletions

View File

@ -168,6 +168,10 @@ class ContactController extends Controller
'</td>'.
'</tr>';
}
}else{
$output.='<tr>'.
'<td>Din søgning matchede ikke nogen personer</td>'.
'</tr>';
}
return Response($output);
}

View File

@ -18,6 +18,7 @@
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på Navn, Email, Telefon"></input>
</form>
<p></p>
</div>
<table class="tbl mt-2">
@ -55,7 +56,14 @@
url: '{{route('contacts.search')}}',
data: {'search':$value},
success:function (data) {
$('tbody').html(data);
if(data == $value){
$('tbody').html(data);
$("p").hide();
}else{
$("p").show();
$("p").html("Det er ingen data der matcher din søgning.");
}
},
error:function (data) {
console.log(data);