You can do this all with JavaScript, it works really slick.  I just did this a 
few weeks ago and wrote a blog post about 
it:http://www.stillnetstudios.com/2009/01/05/dynamically-adding-and-removing-form-elements/
Or you can go the route you are heading, where you ask for how many, then 
submit the form, then in CF loop through 1 to N, writing out form elements and 
naming them as you describe. (firstName_1, etc.).  Also embed the "how many" 
number as a hidden element.
Regardless of which method you use to setup the form, on the form processing 
page you look for that hidden "how many" number and loop 1 to it, processing 
elements along the way.  Look in the comments of that blog post, there is a 
mention in there about how to do this form processing also.
-Ryan

----------------------------------------
From: Les Mizzell <[email protected]>
Sent: Friday, January 16, 2009 5:48 PM
To: cf-talk <[email protected]>
Subject: Controlling the Number of Inputs with a Dropdown 

Basically, I'm looking how to do the below:

In the middle of an existing form, there's a dropdown with 1 to 10 as 
possibe values.

"How Many guests do you wish to bring?"

If I select "5", I then need "firstNAME_1", "lastNAME_1" through 
"firstNAME_5", "lastNAME_5"  input boxes to appear in place underneath.

There's multiple places on the form where this needs to happen.

I'm just getting started with Ajax and CF8, but don't even know exactly 
what I'm looking for to get this to happen and need a pointer in the 
right direction to figure this out. Been googling for a couple of hours, 
but haven't found the right place to start yet.

Ideas please?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318123
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to