Restoring OTHER form field after submit

This is a discussion on Restoring OTHER form field after submit within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi Everyone, On an HTML page with 2x different forms, how can I redisplay the same page after a submit, ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-23-2005
ed_spain
 
Posts: n/a
Default 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

Reply With Quote
  #2 (permalink)  
Old 10-01-2005
strongheart
 
Posts: n/a
Default Re: Restoring OTHER form field after submit

ed_spain wrote:
> 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
>

hi,
perhaps either of these two ideas could help

1) using 2 distinct forms:
include hidden elements that contain the values of the other form
use onchange script in the first form to update the hidden elements in
the other form
post to read both sets of values.

2) use one form :
stylize a single form to appear as two distinct forms - group each
set of elements into separate div elements
you can use 2 submit buttons on a single form so the apparent effect of
2 forms is complete.

hth
~S~







Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0