Tuesday, January 27, 2009

Call Ajax from Javascript Function

Instead of observing a select field to make an ajax request to a
controller action onchange,

I want the onchange to call a custom javascript function that will do
some logic and then make the ajax request to the controller and update
a div afterwards.

So .. how would I do that?

Or, I guess i could just use $ajax->observeField if I can grab the
contents of the select i am observing and pass it to the 'url'=> of
the observeField param?

Eg. $ajax->observeField('someSelect', array('url'=>'myControllerAction/
someSelectContentsHere'));

I need to grab the selected value of the select and pass it to the URL
param of observeField, any way to do that?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: