如何在自动完成中将附加参数传递给php文件

时间:2014-12-23 12:49:49

标签: php jquery autocomplete

我只想在autocomplete.code中将参数传递给php

$(function(){
        $( "#txt_supplier_account_name" ).autocomplete(
        {
           source:'./modules/stock/ajax/ajax.commonsearch.php',
           select: function(event, ui) {
        }
   })
});

2 个答案:

答案 0 :(得分:1)

通过source网址,您可以发送

$( "#txt_supplier_account_name" ).autocomplete(
    {
       source:'./modules/stock/ajax/ajax.commonsearch.php?key1='+value1+'&key2='+value2,
       select: function(event, ui) {
    }
});

ajax.commonsearch.php中你可以GET然后通过网址。

答案 1 :(得分:1)

试试这个

$( "#txt_supplier_account_name" ).autocomplete(
    {
       source:'./modules/stock/ajax/ajax.commonsearch.php?key1=value1&key2=value2',
       select: function(event, ui) {
    }
});