开发者

sending post or get information in jquery autocomplete

Hello we are using the jquery autocomplete function but want to extract information from a php script which is not only dependent upon what is inside the text box. The text box is a contact name coming from a contacts table. Our problem is that we want to pull only those contacts that are associated to a certain company. This company's id will also be in the contacts table so the query will look like this in the script

  $query = "SELECT * 
                  FROM u_contact
                  WHERE full_name like '" . $_GET['term'] . "%' 
                  AND entity_id = '$_GET[ent]'";

where $_Get[ent] would be the id of the compa开发者_StackOverflow社区ny. Ive been looking on jquery website for how to do this without any help. How do I send this get information using just the jquery autocomplete function?


post the data using the $.post("test.php", { name: "John", time: "2pm" } ); like statements so that you can pass ent and the term at a time and get back the results.

Refer : http://api.jquery.com/jQuery.post/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜