Karen,

Your form submits to update.cfm.  Is update.cfm also the page that
contains the form?

If it is, add a hidden form field such as name="ReadyToUpdate".  Have
update.cfm check whether FORM.ReadyToUpdate is defined.  If it is, do the
database update and CFMAIL.  If not, present the form.

If it is not, then you are NOT doing the update and CFMAIL in the same
page.  Move the CFMAIL tag to update.cfm.  Note that the server (think
"CF code") does not know the value of form fields (think "Client") until
the form is submitted.

-David

On Fri, 14 Apr 2000 10:28:31 -0400 "KAREN REITER"
<[EMAIL PROTECTED]> writes:
> 
> --------------34B0238AF1774EA956E192C0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 
> Hi Kevin,
> 
> Okay, I lied, it didn't work like a charm. ; )
> 
> Thanks for your help though.  I am actually trying to have the 
> update and cfmail function occur in the same page.  I am getting it 
> to work, well, sort of.  I am having trouble using
> variables from the form for the to, from and cc fields. I want the 
> user to be able to input the to and from fields within the form- 
> then have cfmail send out the notification to those
> email addresses.
> 
> I have my update form:
> <form action= update.cfm . . . (with input type"text" 
> name="email_to" . . . input type"text" name="email_from")  . . . 
> </form>
> and then my
> <cfmail
> TO=#Form.email_to#
> FROM=#Form.email_from#
> >
> </cfmail>
> 
> It updates the database successfully, but it cannot identify the 
> cfmail to and from variables.  My cfmail tag function itselfs works, 
> because I have tested it by hard coding an email
> address, and not using the variables, and the email notification is 
> sent out.
> 
> Any ideas what I may be doing wrong?
> Thanks for the help (again)!
> 
> Karen
> 
> Kevin Marshall wrote:
> 
> > Karen,
> >
> > Is there any reason that you couldn't use the CFMail tag in the 
> same cf
> > page that inserts the form fields into the data?
> >
> > It would look like this:
> > ---user submits form---
> > <cfquery...> (or cfinsert)
> > Insert into...
> > </cfquery>
> >
> > <cfmail to=#form.to# from=#form.From# cc=#form.CC#>
> > this is an automatic notification that the database has been 
> updated!
> > </cfmail>
> >
> > I would recommend that you do the mail message after the insert 
> (or update)
> > so that if the db operation fails, the message doesn't get sent
> > prematurely.  We currently do something almost exactly like this - 
> except
> > that we don't always use form variables for the from,to,...etc.
> >
> > hth,
> > Kevin
> >
> > At 10:04 AM 4/13/00 -0400, you wrote:
> > >Hi,
> > >
> > >I have a form right now that updates a database in CF.  I would 
> like for
> > >an automatic email notification to occur after the database has 
> been
> > >updated.  The "to, from and cc" fields would be included in the 
> update
> > >form.  Currently, we are using a form2email perl script for email
> > >notification.  I am not familiar with CFMail.  Any ideas how this 
> could
> > >be accomplished within one form?
> > >
> > >Thanks!
> > >Karen
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to