2012-10-03 3 views
0

두 개의 JQuery UI 자동 완성 입력 필드가 있습니다. 첫 번째 옵션에서 옵션을 선택하면 두 번째 자동 완성 필드의 소스 데이터를 보낼 데이터베이스 쿼리의 조건으로 선택 값이 사용됩니다. 제 문제는 어떻게 첫 번째 선택 값을 Post 메서드를 통해 PHP 페이지로 보내야합니까?JQuery UI Autocomplete에서 PHP 메소드로 변수를 전달

지금까지 (이 코드는 GET 방식을 사용하는 튜토리얼입니다,하지만 난 포스트를 사용하려면) 아래 그림은 코드 :

<script> 

          $("input#divisions").autocomplete ({ 
                 //this is the first input 
          source : [ 
             { value: "81", label: "City1" }, 
             { value: "82", label: "City2" }, 
             { value: "83", label: "City3" }          ], 
          minLength : 0, 
          select: function(event, ui) { 
           $('#divisions').val(ui.item.label); 

           return false; 
          }, 
          focus: function(event, ui){ 
          $('#divisions').val(ui.item.label); 
          return false;  
          }, 
          change: function(event, ui){ 
                   //the tutorial has this value sent by variables in the URL; I want the selection value sent by POST. How can I change this? 
           c_t_v_choices = "c_t_v_choices.php?filter=" + ui.item.value; 
           $("#c_t_v").autocomplete("option", "source", c_t_v_choices); 
          } 
          }).focus (function (event) 
          { 
          $(this).autocomplete ("search", ""); 
          }); 

          $("#c_t_v").autocomplete({ 
           source: "", 
           minLength: 2, 
           select: function(event,ui){ 
            //$('#city').val(ui.item.city);    
           } 
          }); 
</script> 

사람이 도와 주실 수 있습니까? 질문이 있으면 언제든지 알려주세요.

답변

관련 문제