To the original author.

I went through this *exact* same situation. I was using the form plugin to
validate and submit forms.

The first approach I took was to move the form to an element. If the request
is an ajax request *only* the element gets rendered. I use the same element
in the non-ajax version. Simply return the element as an empty add form if
the save succeeds or render it with the error array if it fails.

The seconds approach ( and more useful ) was to analyze the generated html
from the error generation in a non ajax validation situation. The difference
in the dom isextremely predictable. Take a not of the html that cake
generates for errors.

Then you json encode the error array and the submitted data. Using the dom
functions in jquery you process the json to build the normal cake dom around
the form elements and repopulate them with the data.

Let me know if this helped at all.
-- 
View this message in context: 
http://www.nabble.com/How-to-capture-validation-errors--%28what-variable-are-they-stored-in-%29-tf4899690.html#a14041707
Sent from the CakePHP mailing list archive at Nabble.com.


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