我尝试在 cakePHP 中做两个输入(类别、子类别)。如果我更改类别输入,我希望 ajax 将值加载到子类别。我能做什么?我使用这样的远程功能:
$ajax->remoteFunction(
array(
'url' => array( 'controller' => 'categories', 'action' => 'loadSubcategories', AND NOW I WANT PUT HERE CATEGORY ID FROM MY INPUT ),
'update' => 'subcategories'
)
);
<select name="categories" id="categories" onhange="MY REMOTE FUNCTION">
CATEGORIES
</select>
<select name="subcategories" id="categories" onhange="MY REMOTE FUNCTION">
LOAD SUBCATEGORIES BY CATEGORY ID WITH AJAX
</select>
我希望你能理解我:)