我陷入困境.我正在使用JS Helper.我使用了以下代码.
<?php $this->Js->get('#client_id')
->event('change', $this->Js->request(array('action' => '../ajax/get_client_location_and_process'),
array('update' => '#client_location_process',
'async' => false,
'dataExpression' => true,
'method' => 'post',
'evalScripts' => true,
'data' => $this->Js->serializeForm(array('isForm' => True, 'inline' => True))
)
)
);
Run Code Online (Sandbox Code Playgroud)
我想在页面加载时触发更改事件.如果我使用document.ready方法,那么它无法正常工作.我无法找到JS Helper方法,我们可以在控件上显式触发一些事件.请建议代码如何在需要时在表单元素上执行类似JQuery trigger()的功能.