I've yet to see a fool proof way of doing this, depending on how much you
care about the form, you could compensate for one quote over the other. If
you know that the value will only ever contain a double quote, use single
quotes in the html, value='whatever', or visa versa.

If you're not sure what the value will be when editing, get rid of all types
of quotes and replace them with the entity name, value, what ever it's
called. " or " for straight down double quotes, another problem
will come about when the left and right double quotes are used. If you don't
care much for them strip all double quotes out and replace with ". DO
the same for single qoutes and it should all be gravey.

Do this stripping when you enter the values into the DB for the first time,
and everytime you edit them. One problem with this is the limits you set on
the input boxes and the DB, because a single character becomes five
characters, namely ". So remeber to compensate for this in the DB. If at
any point you use Left() to only show a small bit of the data, you may
inadvertently chop the 
" in the middle which will then not appear correctly.

I hope that makes sense. I know it did in my head :OP

Ade



-----Original Message-----
From: Deanna Schneider [mailto:[EMAIL PROTECTED]]
Sent: 13 June 2002 13:59
To: CF-Talk
Subject: Quotation Hell


Hi Folks,
A problem has just cropped up that I've never experienced before, and I
swear I'm going insane.

I have a regular ol' form, that's pre-populated with data from a query if
it's an edit, blank if it's an add. Suddenly, if the edit data includes
quotation marks, it's cutting the rest of the item off at the quote marks.
What the heck?!? I've never had this problem before, and I didn't change any
code. Am I nuts?

-d



Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]



______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to