Oh and also, using $ajax->form() will work fine in this case, but I
don't want to use it because it uses a deprecated $html method and I
want to be able to submit to different locations depending on the
button clicked.

On Oct 23, 1:42 pm, corie <[EMAIL PROTECTED]> wrote:
> I'm having a strange issue with $ajax->submit() not writing the
> <script> tag after the <input>, but only inside of an ajax called
> view.
>
> Here is the edit view (called with ajax into another view):
>
> <h2>Edit Category</h2>
> <form method="post" action="<?php echo $html->url('/categories/edit') ?>">
>
>         <?php echo $html->hidden('Category/id')?>
>         <p>
>                 <label for="CategoryName">Name:</label><br />
>                 <?php echo $html->input('Category/name', array('style' => 
> 'width:
> 400px;'))?>
>                 <?php echo $html->tagErrorMsg('Category/name', 'Name is 
> required.') ?
>
>         </p>
>         <p>
>                 <label for="CategoryDescription">Description:</label><br />
>                 <?php echo $html->textarea('Category/description',
> array('rows'=>'5', 'style' => 'width:400px;')) ?>
>         </p>
>         <p>
>                 <label for="CategoryParentid">Parent Category:</label>
>                 <?php echo $html->selectTag('Category/parentid', $cat_select,
> $data['Category']['parentid'], null, null, false, false)?>
>         </p>
>         <p>
>                 <?php echo $ajax->submit('Save', array('update' => 
> '/categories/
> edit')); ?>
>         </p>
> </form>
>
> I've traced through all the functions that $ajax->submit() uses and
> echoed out the results all the way down to $javascript->codeBlock().
> codeBlock() is the function which encloses the $script inside <script>
> tags. I echoed out the $script and it looks okay:
>
> Event.observe('button18502', 'click', function(event) { new
> Ajax.Updater('categories','/cake/categories/edit', {asynchronous:true,
> evalScripts:true, requestHeaders:['X-Update', 'categories']}) },
> false);
>
> But when it tries to return sprintf($this->tags['javascriptblock'],
> $script), nothing is returned.
>
> Again, this all works inside a view NOT called by ajax.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to