Last active
August 29, 2015 13:55
-
-
Save vvikramjhu/8702800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bind_auto_complete_new(){ | |
$('.auto_complete_cve').on('keyup.autocomplete', function(){ | |
search_field_id = $(this).prev().val(); | |
$(this).autocomplete({ | |
source: function(request, response) { | |
$.get('cve_auto_complete_data_new.php', { type_id: search_field_id, search_term: request.term }, function(data) { | |
response(data.split('\n')); | |
}); | |
}, | |
delay: 250, | |
minLength: 3 | |
}); | |
}); | |
} | |
function add_search_field( html_form_id, select_options) { | |
$(get_search_fields( select_options )).prependTo(html_form_id); | |
}; | |
function get_search_fields( select_options ){ | |
return "<div><select name='property_name[]'>" + select_options + "</select> <input type='text' name='search_text[]' class='auto_complete_cve'></div>"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"vendors":["Microsoft (199)","Supermicro (134)","Trianglemicroworks (73)","Michael Vogt (3)","Erik Michaels-ober (1)","Michael Staatz (1)"]},{"products":["Micom S1 Studio (2)","Micom S1 Agile (1)"]}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$public_names_array = get_public_name_from_table($type_id, $term, $mysqli); | |
//$public_names_array = get_public_names($table_id, $term, $mysqli); | |
$public_names_array = flatten($public_names_array); | |
//var_dump($public_names_array); | |
echo implode("\n", $public_names_array ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Microsoft (199) | |
Supermicro (134) | |
Trianglemicroworks (73) | |
Michael Vogt (3) | |
Erik Michaels-ober (1) | |
Michael Staatz (1) | |
Microsoft (199) | |
Supermicro (134) | |
Trianglemicroworks (73) | |
Michael Vogt (3) | |
Erik Michaels-ober (1) | |
Michael Staatz (1) | |
Micom S1 Studio (2) | |
Micom S1 Studio (1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment