Are you sure you don't want to just replace the options within the select?

I don't know for sure, but the way you describe it, you sound like you 
are replacing the whole select tag, which I'd imagine may cause problems.

I have a view that does a similar thing, and the ajax call to replace 
the select is just 5 lines, just returning a list of options (see 
fragment below)

if(!empty($subcategories)) {
 echo '<option value=""></option>';
 foreach($subcategories as $id => $menulabel) {
  echo '<option value="' . $id . '">' . $menulabel . '</option>';
 }
}

I can change the primary selector that influences the secondary one as 
many times as I like without problem this way. The jquery success call 
within the .ajax params is something like this... ( Don't know w/prototype )

  success: function(data, textStatus) {
    $('#yourselectidentifier').html(data);

H


On 11/14/08 13:56, keymaster wrote:
> I’m trying to keep all scripts at the bottom of the page, so the page
> will load quicker.
>
> So, at the bottom of my layout I have an $ajax->observeField() which
> observes a select dropdown at the top of the page.
>
> The first time the select is changed, the observeField()sends an ajax
> request to the server, as expected.
>
> The ajax request replaces the select dropdown, and gives the new
> select the same ‘id’ as the old one.
>
> The observeField() no longer recognizes changes to the new select,
> even though it has the same id.
>
> I would like the replaced select to also be observeable.
>
> Any ideas how this might be done, yet still maintain the scripts at
> the bottom of the page?
>   


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

Reply via email to