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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to