Thank a lot dude.
mike-4 wrote: > > > Huh. Ok, it now works. AND, I know what I was doing wrong, so I'm > going to declare that the pain & suffering were worth it :) > > I tried to put together a quick summary/example so show how it didn't > work, but now it does work. I've pasted the example into the > bin.cakephp thing, in case you (or anyone else) wants to look at it. > Schneimi - how permanent is bin.cakephp? Can I leave it there as an > example, or will it be deleted after a while? > > Anyways, the bin.cakephp addr is http://bin.cakephp.org/view/1771253248 > > What I was doing wrong: > > The observeField documentation clearly states that one option you can > pass to it is the 'with' option; it somewhat ambiguously states that > this is "A Javascript expression specifying the parameters for the > XMLHttpRequest. This defaults to Form.Element.serialize('$field')...", > but between that & some other reading, plus looking at the generated > source, it becomes clear that this is a snippet of Prototype code. > > So if I want to send _everything_ from the form when one element > changes, I do something like this: > > > echo $ajax->observeField('SELECTCOURSE', array( > 'frequency'=>'2', > 'url'=>'/things/update', > 'update'=>array('dynamic1', 'dynamic2' ), > > 'with' => 'Form.serialize(\'ajaxFormID\')' > > ) ); > > My mistake was to add a semi-colon at the end of the Prototype > snippet, like so: > > > 'with' => 'Form.serialize(\'ajaxFormID\');' // NOTE the ; !!!!! > > WITH that semi-colon, it doesn't send the response back to the > server. And since this was all in a dynamic DIV, when I sent this > code to, say, FireFox, I wasn't able to see the code in FireBug, nor > did it print any error messages to the console (IE, likewise, didn't > signal any errors). > > > > Having said all that - I think I'd be willing to write up a short > tutorial on this (since there doesn't seem to be a whole lot of stuff > on CakePHP & AJAX that I found). Do know where I might post such a > thing? I don't have a blog, but maybe I can submit a tutorial to the > bakery? > > Also - thanks for the help with this! I had found a 'workaround', but > not the bug, and probably would have dropped it if I hadn't seen your > reply :) > > Thanks! > --Mike > > > > > > > -- View this message in context: http://n2.nabble.com/Re-AjaxHelper-Adding-an-observeField-to-a-dynamic-div-tp19795p3655739.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
