There are two models, let's say A and B with A hasMany B relationship. User can associate as many B rows as (s)he wants while creating A. The application allow users to dynamically add and remove B rows using JQuery, more specially by following this example - http://jsfiddle.net/mjaric/tfFLt/
Everything works great unless save (using saveAll) fails due to server side validation. In that case, page refreshes on submit and all dynamically added fields are lost and user has to recreate all the rows from start.
Is there any way, none of dynamically added fields using JQuery are lost and retain their old values (same as Cake's default behaviour)? May be making Ajax request is one option so page doesn't reload on server side validation failure but for me that's not an option since the form has one file upload as well and as far as I know Ajax requests do not support file trsnafer?
$this->data. I have lot of applications in this same format. For upload file, just validate all fields before save/upload. - Paulo Rodrigues