Jeg er ikke sikker
This commit is contained in:
parent
8cfca540f4
commit
c9cb3e99cd
skolehjem
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue