You might try cfparaming Form.Field and then referencing Form.Field in
your query, rather just Field. It has to do with which scope is looked at
first by CF.

> I have a form that does not require all fields to be
> filled out.  On the action page, I need to check the
> non-required fields for content, and if empty place
> "n/a" or a zero in the field before the record is
> added to the database.  I tried using <cfparam>, but
> it does not seem to work.  The code is:
> 
> <cfparam name="Pages" default=0>
> <cfparam name="Year" default=0>
> <cfparam name="Service" default="N/A">
> <cfparam name="Position" default="N/A">
> <cfparam name="Ndate" default="N/A"> 
> <cfparam name="Volume" default="N/A">
> <cfparam name="Issue" default="N/A">
> <cfparam name="Authors" default="N/A">
> <cfparam name="ArticleTitle" default="N/A">
> <cfparam name="Source" default="N/A">
> <cfparam name="Other" default="N/A"> 
> 
> <CFQUERY NAME="qInsert" DATASOURCE="request">
> INSERT INTO data (Location, Requested, Service, TDate,
> Position, Extension, NDate, Format, PeriodicalTitle,
>  Volume, Issue,       Authors, Pages, Year, ArticleTitle,
> Source, NLM, Other, Status)
> Values ('#form.Location#',  '#form.Requested#',
> '#Service#', '#TDate#', '#Position#',
> #form.Extension#, '#NDate#', '#form.Format#',
> '#form.PeriodicalTitle#', '#Volume#', '#Issue#',
> '#Authors#', #Pages#, #Year#, '#ArticleTitle#',
> '#Source#', '#NLM#', '#Other#', '#Status#')
> </CFQUERY>
> 
> Any other ideas?
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to