Re: Re: php and dynamic forms

From: Date: Tue, 15 Aug 2006 13:45:01 +0000
Subject: Re: Re: php and dynamic forms
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-240702@lists.php.net to get a copy of this message
At 1:24 AM -0400 8/15/06, Robert Cummings wrote:
On Tue, 2006-08-15 at 13:02 +0800, Bigmark wrote:
Does anyone have a simple example script.
In the first form include a hidden field that identifies the form when you are checking the post values after submission. This way you know exactly what form was submitted. Second if the first form has been submitted then you know that you need to present the second form also. THe second form should also have a hidden field so that it may be identified upon submission. In this way you can detect which form was submitted (submit buttons are problematic for determining which form was submitted). Then when you detect that the second form was submitted you can handle it's data as you please and then only present the first form. A basic example follows (completely unchecked for typos/errors):
-snip- Rob's most excellent code. To expand, one could also run the self referencing loop through a switch statement controlled by the hidden value and have as many "forms" as you wanted. I do this all the time. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#240702) next »