This is the experiment I tried: the following code is a part of a view
element that is rendered with and without the ajax layout:

<?php echo $ajax->autoComplete('Tag/tag', '/tags/
autoComplete',Array('value' => $tag_value));?>

First rendereing of the element with the default layout gives this
output (output 1):

<input name="data[Tag][tag]" id="TagTag" autocomplete="off" value=""
type="text">

<div style="display: none;" id="TagTag_autoComplete"
class="auto_complete"></div>
<script type="text/javascript">new Ajax.Autocompleter('TagTag',
'TagTag_autoComplete', '/tags/autoComplete', {});</script>

Second rendering of the element, using the ajax layout gives this
output (output 2):

<input name="data[Tag][tag]" value="" id="TagTag" autocomplete="off"
type="text">
<div style="display: none;" id="TagTag_autoComplete"
class="auto_complete"></div>

i.e. no javascript. Now I change the template so that I insert output
1 directly into the template and remove the call to the ajax helper.
The resulting output is output 2. The script is gone.

I have no idea why this happens, but it happens.

Sincerely

Nina Jansen

On Dec 12, 10:37 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 12, 2007 4:32 PM, Nina <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'd like to bump this problem, because I have exactly the same issue.
>
> > I have attempted to use javascript instead of using the helper, but
> > somehow the renderer strips the javascript away. I don't know if this
> > is a feature of some sort, but if it is, I'd like to know how to
> > disable it.
>
> I have never seen the renderer 'strip the javascript away', so this
> sounds like there is different problem.  Why on earth would would a
> renderer get rid of anything you put in your templates?
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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