私は ajax ($this->Js->get) を使用してドロップダウンリストの要素を選択し、他のドロップダウンリストに入力しています。しかし、フォーム内にこれらのドロップダウンリストがあります-> create('User')。
したがって、form->create(false) を使用すると、アクション 'edit' が機能しません... 一方、form->create('User') を使用すると、私の 'ajax' は機能しません。
<?php echo $this->Form->create('User', array('action' => 'edit')); ?>
<table>
<tr>
<th>PROJECT</th>
<th>VERSION</th>
</tr>
<tr>
<td> <?php
echo $this->Form->select('projects', array($projects), array('multiple' => false,
'class' => 'span2',
'id' => 'projectsTest'));
?>
</td>
<td>
<?php
echo $this->Form->select('projectversions', array($projectversions), array('multiple' => false, 'class' => 'span2',
'id' => 'projectversionsTest'));
?>
</td>
</tr>
</table>
<?php echo $this->Form->button('ALTERAR', array('type' => 'submit', 'class' => "btn btn-info pull-right")); ?>
<?php
$this->Js->get('#projectsTest')->event('change', $this->Js->request(array(
'controller' => 'ProjectVersions',
'action' => 'getVersionsofProject'
), array(
'update' => '#projectversionsTest',
'async' => true,
'method' => 'post',
'dataExpression' => true,
'data' => $this->Js->serializeForm(array(
'isForm' => true,
'inline' => true
))
)));
echo $this->Form->end();
?>
どうすればこの問題を解決できますか?
前もって感謝します :)