I stuck in a situation. I am using JS Helper. I used the following code.
<?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))
)
)
);
I want to trigger the change event on page load. If I am using document.ready method then it is not working. and I unable to find the JS Helper method where we can explicitly trigger some event on controls. Please suggest the code how can I perform JQuery trigger() like functionality on form elements whenever I need it.
JSHelper
was made for this sort of thing, it's really only for handy ajax requests from my experience. I would say you'll make thind a lot clearer/easier in the long term if you just write out the JS in a .js file... – Jerboa