PHP-Code:
$data = array(
array("Name" => "Test1234", "Last Name" => "Test5678"),
// Add more entries for other data
);
PHP-Code:
// Sample JavaScript code to populate the autocomplete results
$('#autocomplete').on('input', function() {
let input = $(this).val();
let results = [];
// Iterate through the data array
data.forEach(function(item) {
if (item["Name"].includes(input) || item["Last Name"].includes(input)) {
results.push(item["Name"] + ' ' + item["Last Name"]);
}
});
// Display results
displayResults(results);
});
function displayResults(results) {
// Code to display the autocomplete results here
}
Thanks again for your help!
Einen Kommentar schreiben: