>I'm really new to Internet apps and such sorry, if this is a "duh"
question.
What is the standard approach to saving input from a form if on submit
the database connection fails?
If this is a form that actually DOES something, like creating an
account or purchasing something, it is important that the form make
clear to the user one of two results: (a) it worked, here's the
confirmation info, OR (b) it didn't work, please try again later.
(or if the problem is with what the user submitted, tell him
to correct it and try again immediately).
It is very important that the form avoids LYING to the user (telling
him it worked when it didn't (lost customer), or vice versa (double
billed customer), and it is also important that it avoid telling
the user "well, duh, it mighta worked or might not have", leaving
the user wondering whether he should resubmit the data.
I'm thinking along the lines of after the submit the first thing to do
is save the text somewhere (cookie?) and then check for the presence
of the cookie on the form page and if it exists load the text from it.
Destroying the cookie after a successful insert. Am I close or is
there a better way?
It worked or it didn't. No half way. You can let the user submit
again (but database maintenance tends to take half an hour or longer,
not seconds). But don't attempt to save it for later after the
user's left and can't find out whether it worked.
Gordon L. Burditt