Posted by Jerry Stuckle on 05/30/06 01:48
Ian Davies wrote:
> Hi me again,
> sorry to be a pain. Ive been struggling with this one all day. Hope you can
> understand whats happening. First my script is below. Have a look and I'll
> explain at the bottom what it does so far and is failing to do
>
<code sniped>
> first form
> OK well first an array of buttons is created with their values coming from a
> database. a textbox is filled and radiobutton selected when this form is
> posted on clicking a button in the array the page is resubmitted
> ('PHP_SELF') resulting in sessions being created from the text field and
> radio buttons. The values of the textfield and radiouttons are set to the
> sessions so that the values persist on the page during 'PHP_SELF'.
>
> Problem arrises on the second form where values from a list are posted and
> copied into the final textfield at the bottom. During this second form
> posting the values in the textbox and radio buttons are lost. I want them to
> remain until the sessions are made false. can anyone help.
>
> I know its alot of code to untangle but Im really stuck on this one
>
> Ian
>
>
Ian,
I haven't looked at your code in detail - but I think your problem is how the
data is being submitted.
When you submit a form, only data from that specific form is in the $_POST (or
$_GET) value. Data from other forms on the page will not be submitted.
If you want to keep data from the first form after submitting the second one,
you have a couple of choices. You can put the first form data in the session
(my favorite). You can also store it in hidden fields in the second form (also
works well).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|