Restoring OTHER form field after submit

E

ed_spain

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.

Thanks,
Ed Eichman
Spain
 
E

Evertjan.

ed_spain wrote on 23 sep 2005 in comp.lang.javascript:
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.

If you submit to the same page, you can pre-fill both forms as you like.

However this is serverside php coding in your case, so off topic.
 
E

ed_spain

Thanks Evertjan,
If you submit to the same page, you can pre-fill both forms as you like.

However this is serverside php coding in your case, so off topic.

In a single form, I know how to use PHP to retreive the user enter
values and restore them if the same form needs to be displayed again
(e.g. if they fill in the billing info, and forget to specify their
city - redisplay the form with the input info and tell them to complete
the form correctly).

However, there are TWO forms, and I need to be able to get the values
which are ONLY in the HTML form which is NOT being submitted - which is
why I though Javascript might be the solution (using javascript to put
the form #2 values into a hidden field in form #1 so that my PHP code
can catch the values and restore them).

.....or, what I'm really looking for are ideas on how to make the whole
thing "easy" - trying to see if I've missed something simplier.

Thanks,
Ed
 
E

Evertjan.

ed_spain wrote on 23 sep 2005 in comp.lang.javascript:
Thanks Evertjan,


In a single form, I know how to use PHP to retreive the user enter
values and restore them if the same form needs to be displayed again
(e.g. if they fill in the billing info, and forget to specify their
city - redisplay the form with the input info and tell them to complete
the form correctly).

However, there are TWO forms, and I need to be able to get the values
which are ONLY in the HTML form which is NOT being submitted - which is
why I though Javascript might be the solution (using javascript to put
the form #2 values into a hidden field in form #1 so that my PHP code
can catch the values and restore them).

Nonsense, info in the html must be known to he serverside, otherwise the
html could not be rendered serverside.
....or, what I'm really looking for are ideas on how to make the whole
thing "easy" - trying to see if I've missed something simplier.

Please reread the thread. And fix this serverside.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top