Hi Phunkster,

There's more than one way to do things but: don´t prefix your urls
with /ajax/. It´s simply not necessary and will further complicate
things.

1) If you include the RequestHandler component, it will ensure that
normal requests have a layout, and ajax requests do not.
2) Regarding validation, the result of your ajax form submit will be
put in the div that you nominate as the target. What does that mean? If
you wrap the form in a div named comment_update and the ajax form
'update' parameter is comment_update, if there are validation errors
the form will be redisplayed (assuming a 'standard' controller for
comments). If you successfully save the comment you could use
requestAction to return the display for the newly saved comment, to
replace the form. That's one solution anyway.
3) Ajax code, generated by the ajax helper, is degradable. Hence it
will still work if you have js disabled.

If you prefer to see code that works and use that as a basis, here are
a few working examples for you, which work with or without js enabled:
http://www.noswad.me.uk/Pagination/Form
     An extremely simple ajax form example, search for ´the´ to get
some results. source code available via the "download me"

http://www.noswad.me.uk/MiBlog/Demos
    My blog is itself a demo, the way comments works is exactly as you
are describing. Have a browse of the source (from
http://www.noswad.me.uk/Demos). It is not perfect and could easily be
improved (O if I had the time), but the way comments work should be
fairly clear and do what you want.

HTH,

AD7six


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

Reply via email to