I am trying to maintain some key data that gets lost if an error is thrown prior to submit (beforeSubmit).
It seems that when a user enters data on a form and submits it, if an error gets thrown prior to writing to the database and the error is displayed (with the 'back' button), when the user clicks back, the form loads but the data in the fields is gone.
So I tried setting a session variable on beforeSubmit with a special keyname and then reading on beforeLoad thinking that this would allow me to pass in data to the fields if the keyname matched (I'd know there was an error thrown) and I would set the fields with the stored data.
This seems to not work using the back button but only if fully loaded. Here is the steps and results at each step:
1. beforeSubmit: set session variable
2. error gets thrown and displays on screen to user with back button.
3. user hits back button and form loads (fields empty, session does not set fields)
4. hit the browser refresh button and form loads (fields completed with session information)
So my question to those that know: Is the return from a thrown error cause a beforeLoad event. It seems like it does/should. In any case, returning from a thrown error does not seem to provide the session set in the prior beforeSubmit. Am I missing something? Should it work as I want it to?
Edit:
Also, is there a way to remove a session? Can I pass NULL to setSetting?
Thanks.
-Steve