If you really want to prevent all users errors inside your forms (as
it's not always a good idea, but we don't always have the choice to
decide), I see two ways to solve the problem :
- Avoid the external links on your forms if possible, or warning user
that his data will be lost (not really simple and elegant).
- "Manually" save user's data on blur event or periodically, using Ajax
on client side and the isValidPartial() method (or processAjax() if you
want to retrieve the error messages) on server. Store user data into
session, and use it to populate the Zend_Form before (re)displaying.
Hope this helps...
Lucas
gibler a écrit :
Is there a way of keeping unsaved data i.e not yet submitted for a zend form?
I've discovered that users are navigating (by following links on the webpage
that has the form) away and when they use the back button to get back to the
form, they get a nice empty form showing.
My controller logic is based on
http://akrabat.com/2008/02/21/simple-zend_form-example/
http://akrabat.com/2008/02/21/simple-zend_form-example/ .