not sure of your problem... but try to put the java function BEFORE
the ajax calling and give it a try. Javascripts always mess with me in
this kind of way... maybe it helps you.
<script type='javascript'>
function testCall() { alert('[EMAIL PROTECTED]');}
</script>
<?
echo $ajax->form('addComment', 'post', array(
'model' => 'Comment',
'url' => array('controller' => 'comments', 'action' =>'add'),
'update' => 'pureGenius',
'complete' => 'testCall();'));
?>
..........................................
On Oct 6, 3:55 pm, Chez17 <[EMAIL PROTECTED]> wrote:
> The "complete" option works fine if I put the javascript directly into
> the array. However if I try to put it in a function in the array it
> doesn't work. Take the following example:
>
> <?
> echo $ajax->form('addComment', 'post', array(
> 'model' => 'Comment',
> 'url' => array('controller' => 'comments', 'action' =>'add'),
> 'update' => 'pureGenius',
> 'complete' => 'testCall();'));
> ?>
>
> <script type='javascript'>
> function testCall()
> {
> alert('[EMAIL PROTECTED]');}
>
> </script>
>
> If I put the alert in the ajax array, it works fine. Doesn't work as
> it stands. Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---