Again, an all around bad idea. Why bother setting a param for it at all? The
query will always take care of setting the value and the param will not be
used. The only good the cfparam would be would be to set the query value to
another var like form.fieldname

If you use that value to set a param for a form field like form.fieldname
and then use #form.fieldname# as the value="#form.fieldname#", whatever is
in that field when you submit the form can persist incase there were errors
that you wanted to inform the user about. 

As you are saying, if you submit the form to itself and any server side
checks fail and the user is shown the form so they can correct any problems,
all of their entered data is gone and all of your original information is
back.

Make sense?
 
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

-----Original Message-----
From: Aaron Rouse [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 17, 2005 10:38 PM
To: CF-Talk
Subject: Re: Cfparam question

It does work, our POS framework at work does it. A query with zero record
count returns blanks for the fields. At the top of a form that is used for
both input and updating a query can run to pull out all the fields and then
a cfparam just needs to be done on the PK so that by default it is equal to
a non-existant one such as ID = 0. Then essentially for something like a
text input it does something like <input type="text"
name="whatevertheDBfieldnameis" value="#GetData.whatevertheDBfieldnameis#">

On 11/17/05, Bobby Hartsfield <[EMAIL PROTECTED]> wrote:
>
> If it would even work (without undefined var errors when no record was
> found) it's an all around bad idea for a few different reasons.
>
>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224589
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to