I want that the following code pass var1,2 and 3 to the autofill.php so i can gather them using $_GET :
<script type="text/javascript">
$(document).ready(function() {
$( "#name" ).autocomplete({
source: function(request, response) {
$.ajax({
url: 'autofill.php',
dataType: "json",
data: {
term : request.term,
var : 3,
},
success: function(data) {
response(data);
}
});
},
select : function(event, ui) {
//pass var1,var2,var3 to php file
},
autoFocus:true,
minLength: 3
});
});
</script>
the "source : function" works very well i can pass the var = 3 that decides which function to execute from autofill.php but I can't manage to send the data I need on select.
selectwill do.