Jeff just brought up a really interesting point about "namespaces" that made
me think of another important thing, validation!!! In a previous post
someone mentioned some weird error they got, email titled "Weird Error". If
you check my reply to that you'll find an instance of how the variable wuz
named with a minus sign (-) in the name & caused an error. You might want to
validate against that & other things like spaces. Replace() should do that
just fine like this:
#Replace(blah,"-","_","ALL")#
so on so forth...
Your definantly going to have to validate against many things. Use a
namespace like Jeff pointed out as well or you'll run into trouble.
Sincerely,
Mike Lakes
>From: "Jeff Beer" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: RE: Kooky Form Field/List question.
>Date: Mon, 20 Nov 2000 11:33:41 -0500
>
>Just do:
>
>File Name Field Value
>#test#: #Evaluate("form." & test)#
>
>
>I'd also be careful about having students name their form fields with the
>same name as any 'control' info or variables you may have in this page.
>I'd
>use an unlikely variable prefix, maybe "wr_mail_varName" - for Willy Ray
>Mail :-)
>
> > -----Original Message-----
> > From: Willy Ray [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, November 20, 2000 10:48 AM
> > To: CF-Talk
> > Subject: Kooky Form Field/List question.
> >
> >
> >
> > I work on a college campus, and frequently I'm asked by
> > faculty/staff/students, why they can't just make a form in front
> > page express and have it send them an email (and we don't have
> > the server extensions). I have the hardest time explaining what
> > a form handler is, and how frontpage just can't do it.
> >
> > So, I decided to make a generic Coldfusion form handler.
> > Something that, provided it was passed an email address, subject
> > line, and a redirect URL (for the success message), it would make
> > an email to the address. Ok, this is the easy part. I have it
> > already. The problem is, I need also to pass *any form fields*
> > other than the ones required for the email in the body of the
> > email. Biology is going to need different things on their form
> > than accounting, see, so I want to make this thing totally generic.
> >
> > So, here's the problem. I can use the automatically-created
> > FORM.fieldnames list to get the field names onto the email like this:
> >
> > <cfloop index="test" list="#FORM.fieldnames#" delimiters=",">
> > #test# : <br>
> > </cfloop>
> >
> > This code puts the names of the form field onto the email. Easy.
> > I can also test them for whether or not they're one of my
> > required fields, and not print them if they are. What I can't
> > do is print the VALUE of the form fields. Make sense? I was
> > hoping I could do something like this:
> >
> > <cfloop index="test" list="#FORM.fieldnames#" delimiters=",">
> > #test# : #FORM.#test## <br>
> > </cfloop>
> >
> > Yeah, but I can't. Any thoughts?
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 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
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>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
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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