Ajax Autocomplete for Jquery : How To Send Dynamic Parameters

前端 未结 6 1389
感情败类
感情败类 2021-01-17 22:03

i am using Ajax Autocomplete for Jquery ( http://www.devbridge.com/projects/autocomplete/jquery/ ) in one of my application. The Search Form looks something lik

6条回答
  •  忘掉有多难
    2021-01-17 22:39

    Pez's answer didnt work for me just a slight variation with 'extraParams'. This makes the parameters dynamic rather than set on page load...

    $("#field").autocomplete('pageurl.php', {     
       width: 240,
       matchContains: true,
       mustMatch: false,
       selectFirst: false,
       extraParams: {
          start:function () { 
               return $("#start_date").val(); 
          },
          end: function () {
               return $("#end_date").val() ;
          }
      } 
    });
    

提交回复
热议问题