Re: How to do "Add More"/expanding forms?

From: Date: Thu, 30 Aug 2001 17:34:17 +0000
Subject: Re: How to do "Add More"/expanding forms?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65339@lists.php.net to get a copy of this message
Try looking for javascript solutions. Give them the default 5 and a javascript function that prints out another input variable and dynamically names it. Then you can just normally post at the end. i don't think the javascript is difficult either, and i'm sure you could find a script for it. check dynamicdrive.com hotscripts.com and google. Jack Chris Bailey wrote: > I have a page that is for a little recipe database app. On the page where > you enter your recipe, there is a set of form fields for ingredients - one > line per ingredient, and a couple of fields per (e.g. amount, measurement, > ingredient). > > I'd like to have say 5-10 ingredient lines in the form by default, but put > an "Add More" button next to the last one that will let the user say add 5 > more ingredient lines to the form. How can I do this? > > The problem for me is that I figure I'd want the Add More button to either > do a POST to the same page (and add a parameter indicating the number of > ingredient lines to use or something like that), but that the standard form > Submit/Add Recipe button would go to a different PHP page that actually > inserted the recipe into the database. But, this requires two forms and > thus I'd lose the recipe's form variables when hitting one or the other of > the buttons. > > I've looked around online for solutions to this, but haven't found any. Can > someone point me in the right direction? > > ____ > Chris Bailey mailto:chris@codeintensity.com > Code Intensity http://www.codeintensity.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#65339) next »