1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| $(document).ready(function() {
$("#find_filtre").on("change", function() {//changement du filtre
if ($('#find_cours').val().length > 2){
recherche();
}
});
$("#find_cours").on("keyup", function() {//saisie de 3 lettre dans le champ recherche
if ($('#find_cours').val().length > 2){
recherche();
}
});
//permet de fermer la fenêtre de recherche modal
$("#modal_off").on("click", function() {
$("#modal_recherche").css('display', 'none');
})
function recherche() {
var motcle = $("#find_cours").val(); //recupération du mot cle
var filtre = $('#find_filtre').val(); //filtre all par default
$("#wait").css('display', 'block'); //faire apparaître le loading
$("#modal_recherche").css('display', 'block');
$("#find_cours").css('color', '#046380');
$.ajax({
type: 'POST',
//url : 'prod/script/recherche/ajax_motcle.php',
url: '/script_veto/recherche/ajax_motcle.php',
data: {
motcle: motcle,
filtre: filtre,
},
success: function(data) {
$("#wait").css('display', 'none');
$('#resultat_box').html(data);
},
});
}
}); |
Partager