Good point about the hidden form field tho -- that would keep the data that
needs to be paramed to ensure existance on the action page together with the
form, which has its advantages.

> If your form has a lot of checkboxes, which DO NOT exist
> in the FORM struct
> if they are not selected, you may want to also pass a
> hidden field with a
> list of checkbox field names you can use on the subsequent
> page;

> <input type="hidden" name="checkboxfields"
> value="mycheckboxfield1,mycheckboxfield2,mycheckboxfield3"
> >

> Then loop over THIS list, to create default params for
> fields which may not
> exist in the FORM Struct. If the checkboxes on the form
> are not dynamic,
> you could also just hardcode this list into a loop on the
> processing page...

> At 07:45 PM 13/11/02 -0500, you wrote:
>>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


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.

Reply via email to