2012-02-29 15 views
0

私はcakephpでajax関数を取得しています。これはドロップダウンがクリックされて別のドロップダウンに移るときに呼び出されます。私が得ることができない1つの領域は、最初のドロップダウンのid値を渡しているので、私は見つけることができます。cakephp ajaxのドロップダウン値

私は関連する従業員を得ることができるように私は会社のIDを渡したいと思います。

ありがとうございました。

閲覧:

<?php 
$this->Js->get('#MonthlyReturnCompanyId')->event('change', 
$this->Js->request(
    array(
     'controller'=>'MonthlyReturns', 
     'action'=>'getemployees', 
    ), 
    array(
     'update'=>'#test', 
     'async' => true, 
     'method' => 'post', 
     'dataExpression'=>true, 
     'data'=> $this->Js->serializeForm(array(
      'isForm' => false, 
      'inline' => true 
     )) 
    ) 
) 
); 
?> 



     echo $this->Form->input('company_id' , array('empty' => true)); 

答えて

0

単にリダイレクト すなわちで行わ同じアクション要求でのcompany_idを渡す:

$this->Js->request(
array(
    'controller'=>'MonthlyReturns', 
    'action'=>'getemployees',$company_id), 
array(
    'update'=>'#test', 
    'async' => true, 
    'method' => 'post', 
    'dataExpression'=>true, 
    'data'=> $this->Js->serializeForm(array(
     'isForm' => false, 
     'inline' => true 
    )) 
) 
) 
); 
関連する問題