Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Restoring OTHER form field after submit

Reply
Thread Tools

Restoring OTHER form field after submit

 
 
ed_spain
Guest
Posts: n/a
 
      09-23-2005
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

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      09-23-2005
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)

 
Reply With Quote
 
 
 
 
ed_spain
Guest
Posts: n/a
 
      09-23-2005
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

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      09-23-2005
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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
Pass hidden form field value to another form field to insert in db GavMc ASP General 4 09-22-2005 06:33 PM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven Javascript 3 05-13-2004 12:15 AM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven ASP General 3 05-13-2004 12:15 AM
Form Field/ Form Submit Problems (probably an easy answer...) Eric ASP General 4 09-24-2003 12:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57