search functionnality
This commit is contained in:
parent
14fdc8e10c
commit
cc3663f1a5
@ -91,7 +91,7 @@
|
||||
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" placeholder="Search" aria-label="Search">
|
||||
<input class="form-control form-control-dark w-100 rounded-0 border-0" id=searchUser type="text" placeholder="Search" aria-label="Search">
|
||||
<div class="navbar-nav">
|
||||
<div class="nav-item text-nowrap">
|
||||
<a class="nav-link px-3" id="signout" href="#">Deconnecté</a>
|
||||
|
@ -98,6 +98,15 @@ instance.get("users", {withCredentials: true, params :{ page:page, nbPages: nbPa
|
||||
|
||||
document.getElementById("addUser").addEventListener("click", function(){
|
||||
location.href="/html/adduser.html";
|
||||
});
|
||||
|
||||
document.getElementById("searchUser").addEventListener("keydown", function(ev){
|
||||
if(ev.key === "Enter"){
|
||||
var search = document.getElementById("searchUser").value;
|
||||
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(search)){
|
||||
alert(search);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user