I have this code
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type='text/javascript' src="js/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery.autocomplete.css" />
<script type="text/javascript">
$().ready(function() {
$("#course").autocomplete("autocomplete.php", {
width: 300,
matchContains: true,
mustMatch: true,
minChars: 0,
//multiple: true,
highlight: false,
//multipleSeparator: ",",
selectFirst: true
});
});
</script>
<input type="text" name="course" id="course" size="100"/><br><br><br>
<input type="text" name="id" id="id" size="100">
That generates this result:
AndIhavetwoinputtext
init.Itispossibletonoticethatwhentheuserpressesakey,thefunctioncallsthefileautocomplete.php
whichreturnsaresultinjson.
{"name": "Augustine", "id": "1"}
What I need now:
I wanted to distribute the results:
nome
and id
on different inputs.
The name go to the course
field and the id go to the id
field
How can I proceed in this case?