Ajax Database example from w3schools jquery driven [closed]
Hello i need the code from http://www.w3schools.com/ajax/ajax_database.asp rewritten in jquery(if possible) but more important for my project is on load the first customer to be already gathered from the db and eliminate the Please select option. Anybody could help me please .. I'm trying to do a kind of select sort/filter based on this example for my website,
Thank you
I made it myself .. but thanks for the votes :) I will add here maybe somebody will be interested
<script type="text/javascript">
$(document).ready(function() {
$("select[name='customers']").attr("selectedIndex", 1);
$("select[name='customers']").change(function() {
var str = $(this).val();
if( str == "" ) {
$("#txtHint").html("");
}
else {
$.get("getcustomer.asp", {"q": str}, function(data) { $("#txtHint").html(data) });
}
}).change();
});
精彩评论