Review Web Form Entry Before Final Submission
"Douglas S. Davis" <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Organization | Haverford College |
| Message-ID | <004e01c52b25$16df1470$0e3c52a5@dsddelllap> |
Hi,
I write a lot of programs in Perl that display a web form, and the user then
fills it in, and I like to give them a chance to review the information that
they've submitted and have the opportunity to go back (via the Back button
in their browser) to make changes before the final "set in stone"
submission.
What's the best way to do this?
What I've been doing is this:
A Perl script creates the form (or sometimes it's just a standard HTML
page).
The user fills it in then clicks "Preview" or some such button.
The form data is processed by a ReadParse subroutine from cgi-lib.pl and
then spit back out as a webpage to show the data the user submitted.
The data is also in a form on that page with all of the data as hidden
fields which if they click Submit will then be sent to a MySQL database.
If they click the Back button in their browser instead of Submit, they can
make changes, Preview and Submit/Edit again ad infinitum.
It's rather tedious to have to spit their data back at them and have it all
in a form as hidden fields, but I haven't figured out a better way to do it.
I'd like to have the data go to a MySQL database when they click Preview,
and then if they click Back and edit the info, the data in the database
would just be updated, but how would I do that? They'd have to get some
type of unique ID that would be present in the page when they go back to it
or it would have to be present when they first load the web form so that the
data could be matched up.
I'm sure there are much better ways to do it than what I'm doing. Please
enlighten me.
Douglas
--------------------------------------
Douglas S. Davis
Programmer/Analyst
Haverford College
Department of Administrative Computing
370 Lancaster Ave.
Haverford, PA 19041
610-896-4206
[email protected]
http://www.haverford.edu
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]