Hi Bill,

Thanks for the additional advice.  However, when I made the change you
suggested (that is, adding "<cfparam name="form.MiddleInit" value="">" to
the code in the action page), I got the following error message:

Error Diagnostic Information
Just in time compilation error

An unknown attribute 'value' has been encountered at document position
(12:36) to (12:40) while processing tag CFPARAM. This tag can only take the
following attributes:

DEFAULT
NAME
TYPE
The last successfully parsed CFML construct was a CFPARAM tag occupying
document position (12:4) to (12:11).

This is the code I used:

<CFIF IsDefined("FORM.UserID")>
 <CFQUERY DATASOURCE="#DB#">
  UPDATE Users
  SET FirstName='#FirstName#',
      MiddleInit='#MiddleInit#',
      LastName='#LastName#',
      UserName='#UserName#',
      Password='#Password#',
      UserEmail='#UserEmail#',
      PhoneHome='#PhoneHome#'
   WHERE UserID = #UserID#
   <cfparam name="form.MiddleInit" value="">
 </CFQUERY>
 <CFELSE>
 <CFQUERY DATASOURCE="#DB#">
 INSERT INTO Users(FirstName, MiddleInit, LastName,
                   UserName, Password, UserEmail,
       PhoneHome)
 VALUES('#FirstName#','#MiddleInit#','#LastName#',
   '#UserName#','#Password#',
  '#UserEmail#','#PhoneHome#')
  </CFQUERY>
</CFIF>

<CFLOCATION URL="AdminPage.cfm">

It didn't matter where in the above I put the code you sent me, I still got
the same message.  When I changed "value" for "default", "name" or "type", I
got other error messages.

Hubert
---
Hubert Earl

ICQ#: 16199853
AIM: hubertfme

My Jamaican Art, Craft & More Online Store:
http://www.angelfire.com/ny/hearl/link_page_on_angelfire.html


----- Original Message -----
From: "Bill Davidson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, April 28, 2001 9:09 PM
Subject: Re: How can I get CF to ignore a form field with no data?


> Oops.  The other thing you can do is stick in a cfparam in the action
page.
> like,
> <cfparam name="form.MiddleInit" value="">
>
> Then if MiddleInit is undefined, it will be defined as an empty string,
> otherwise it is left alone.... = no error.
>
> -Bill
> www.brainbox.tv
>
> ----- Original Message -----
> From: "Hubert Earl" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Saturday, April 28, 2001 7:05 PM
> Subject: How can I get CF to ignore a form field with no data?
>
>
> > Hi,
> >
> > How can I get CF to ignore a form field with no data? I have a form with
a
> field called MiddleInit which will not always be filled in.  At the
moment,
> however, an error message is generated if that field is blank.
> >
> > Sincerely,
> > ---
> > Hubert Earl
> >
> > ICQ#: 16199853
> > AIM: hubertfme
> >
> > My Jamaican Art, Craft & More Online Store:
> http://www.angelfire.com/ny/hearl/link_page_on_angelfire.html
> >
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to