By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

Restoring OTHER form field after submit

P: n/a
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

Sep 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Sep 23 '05 #2

P: n/a
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

Sep 23 '05 #3

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


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.
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Sep 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.