473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Restoring OTHER form field after submit

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
3 1726
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
1
by: Richard Dixson | last post by:
I have code that calls document.myFormName.submit() to submit a form automatically via JavaScript. This works just fine. However, if there is a button (or other form field element) on the form...
1
by: ed_spain | last post by:
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...
2
by: Cerebral Believer | last post by:
Hi folks, Can anyone help me with this form: http://futurebydesign-music.com/_member/club_fbd_reg.php I have followed to coding instructions aas closely as I can, but I am getting errors...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.