Click to See Complete Forum and Search --> : How do you retain info in a form


Mr.Mike
09-07-2003, 11:37 PM
How do you temperarely retain info in a form enviroment?

problem: I'm using one of matts form scripts, and if the client forget to enter info in a field it has a error when submited telling them what they missed,(which is what we want) but when they click back button to enter what was missed in field, all info has to be reentered again. It's too much to keep redoing. so how do we retain the info being submited to the form for a short time period so folks can just fix what was missed the first time and be done with it ?

What are we talking here; perl, java script, cookies ??


Regards,
Mike

GaijinPunch
09-08-2003, 12:29 AM
This is more of a work-around than a solution...especially w/o seeing the script.

Perl is the only thing I know web-wise. What you might want to think of doing (assuming you're using GET as the method, which puts the variables in the URL) is make a "go back" button, which links them to the previous page, and grabs the variables from the URL and puts them where they need to go.

In perl, if the URL of the page after the form was: www.myserver.com/script.cgi?name=bob&age=20&sex=male
Make a link that goes back to the form, and has something like this in it.

You'd put something in the script like
my $name = $cgi->param('name');
my $age = $cgi ->param('age');
my $sex = $cgi->param('male');

(Note that you'd need to declare $cgi as a CGI object first... if your script is in perl, it's likely already done).

Now, your script has the variables - you just stick them in the right text boxes. The kicker is, the page that generates the form needs to have some type of CGI in it. Straight up HTML won't cut it. :(

Mr.Mike
09-08-2003, 01:06 AM
We're using post not get; changed it and GET it didn't change anything.

Yes form is all html..

What kind of cgi need sto be added to the form?


Mike


Script attached
=======================================

GaijinPunch
09-08-2003, 10:11 PM
Hmm... I'd really need to see the script.

Heres' something, that's probably an obvious qusetion -- is this on a secure server? (https://) as opposed to (http://)?

I know most secure servers like to nuke everything when you use the back button.

Mr.Mike
09-11-2003, 07:15 AM
Never mind..... Folks

My problem has been solved

thank you,:D

Duke Will
09-11-2003, 07:42 AM
Originally posted by Mr.Mike
Never mind..... Folks

My problem has been solved

thank you,:D

Well, why don't you tell us HOW it was solved? Inquiring minds want to know.

Kyle, age 6, says PLEASE click here bRIEfLY (http://www.wepay.com)