Restoring OTHER form field after submit

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi Everyone,

On an HTML page with 2x different forms, how can I redisplay the same
page after a submit, restoring the values from BOTH forms even though
only one was submitted?

I have an existing PHP program that I am modifying, and need to
redisplay the same page after a submit (the button that submits is a
"change shipping" button, that allows the user to continue with the
rest of the page). The problem is that there are TWO forms - the one
that allows you to change shipping, and the other where the user can
fill in the billing address. Making this into one form is not really an
option, due to how the program is set up.

Since they are 2 different forms, submitting the "change shipping" form
does NOT bring the billing address fields to my PHP code in the POST.
This makes restore difficult.

I have a couple of kludgy ideas on how to work around this (mostly
javascript based - e.g. setting hidden fields in the "change shipping"
form when the user is changing the billing fields). However, I was
wondering if there were any other easy solution to acheive this.

Ed Eichman

Re: Restoring OTHER form field after submit

ed_spain wrote:

Quoted text here. Click to load it

Correct - any changes that the user made to the other, not submitted form
are lost.
The only thing you can do is to recreate the other form with the values as
they where when the page was sent to the browser (an easy task, if the form
was not prefilled ;)
You'll have to look at the code that created the page and clone the relevant
pieces - which is not a HTML related task, so you better look for a PHP
group/forum for help (or perhaps even a group for this specific shopping
application, if there is one).

Quoted text here. Click to load it

This _would_ work, if you _could_ rely on the presence of JavaScript - which
you *can't* (on a public site).

Benjamin Niemann
Email: pink at odahoda dot de
WWW: /

Site Timeline