Had to do it...

<cfloop index="field" list="#getThis.columnlist#">
        <cfparam name="form.#field#" default="#getThis[field]#">
</cfloop>
 
that’s only if you want the values from the database to be the default
values of the fields though. Just use default="" if that’s not what you're
looking to do.

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 17, 2005 3:36 PM
To: CF-Talk
Subject: RE: Cfparam question

I've done this before. In my admin pages, MOST of the text fields are tied
directly  to database fields of the same name. In the edit portion of the
code, I select all of the information for that record, then use the
columnlist attribute of the cfquery to loop over a cfparam tag like so:

<cfquery name="getThis">
        query here
</cfquery>

<!--- Make sure that the getThis query.recordcount has contents --->
<cfparam name="getThis.columnlist" default="#getThis.columnlist#">

<cfloop index="field" list="#getThis.columnlist#">
        <cfparam name="CLIENT.#field#"
default="#Evaluate("getThis."&field)#">
</cfloop>

<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Mike | NZSolutions Ltd [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 5:39 PM
To: CF-Talk
Subject: Cfparam question


I have a very long form - 30 or so questions. Not all of the questions
are required and not all are submitted through to the processing page.

Can I use a loop to set a default value for each form element with out
having to use...

<cfparam name="FORM.abc" default="">
<cfparam name="FORM.def" default="">

Mike




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224540
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to