57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
// Anders als sonst. Hier ist das Javascript auf der ID des Textfelds
|
|
// https://stackoverflow.com/questions/8300381/jquery-ui-autocomplete-how-to-send-post-data
|
|
|
|
$("#titel").autocomplete({
|
|
source: function(request, response) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "../controller/admin_suche.php",
|
|
data: {
|
|
term: request.term,
|
|
function: "titel"
|
|
},
|
|
success: response,
|
|
dataType: 'json',
|
|
delay: 10
|
|
});
|
|
}
|
|
}, {
|
|
minLength: 2
|
|
});
|
|
|
|
$("#verlag").autocomplete({
|
|
source: function(request, response) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "../controller/admin_suche.php",
|
|
data: {
|
|
term: request.term,
|
|
function: "verlag"
|
|
},
|
|
success: response,
|
|
dataType: 'json',
|
|
delay: 10
|
|
});
|
|
}
|
|
}, {
|
|
minLength: 2
|
|
});
|
|
|
|
$("#songbook").autocomplete({
|
|
source: function(request, response) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "../controller/admin_suche.php",
|
|
data: {
|
|
term: request.term,
|
|
function: "songbook"
|
|
},
|
|
success: response,
|
|
dataType: 'json',
|
|
delay: 10
|
|
});
|
|
}
|
|
}, {
|
|
minLength: 2
|
|
});
|