You could but there wouldn't be any reason. The cfparam will only set values for form fields which don't already exist, and the loop would be looping over fields that already exist in the form, so you wouldn't get your defaults for non-existing form fields and the whole thing would just be a waste of processor cycles roughly analagous of <cfset form = form>.
> Could I loop through the form collection like so? > <CFLOOP collection="#FORM#" index="myForm"> > <CFPARAM name="FORM.#myForm#" default="" type="string"> > </CFLOOP> > -----Original Message----- > From: S. Isaac Dealey [mailto:info@;turnkey.to] > Sent: Wednesday, November 13, 2002 1:45 PM > To: CF-Talk > Subject: Re: loop through form fields >> I have form with a lot of options and most are optional. >> What's the best way to loop through all form fields and >> set a default value >> of ''? >> Thanks, >> Dave > <cfloop index="x" list="#myfieldlist#"> > <cfparam name="form.#x#" type="string" > default=""></cfloop> > Isaac > Certified Advanced ColdFusion 5 Developer > www.turnkey.to > 954-776-0046 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~~| > Archives: > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 > Subscription: http://www.houseoffusion.com/cf_lists/index. > cfm?method=subscribe&forumid=4 > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > This list and all House of Fusion resources hosted by > CFHosting.com. The place for dependable ColdFusion > Hosting. Isaac Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com

