I haven't checked too much to see if this is what you want, but this takes
out left, right and straight(?) double quotes and inserts the entity name
for double quotes in to the database instead

value="#trim(replacelist(form.var, "","","", "",",""))#"

But.......

a problem I came across comes up when you have this in the DB.........

"Hello"

and you try to display 14 characters, you end up with 

"Hello&qu

in a prefilled textbox for example.

A simpler way around this if you are only going to be pulling double qoutes
from the DB is to use single quotes in the html code, this is the way you
get around the problem using html.

Another way, would be to check to see if the string you get from the DB
contains a double qoute and change the value="" to value='' in the html
code, or vice versa.

The problem with these is that if both single and double qoutes are being
pulled, then ya stuffed.

I hope that made sense

Ade

Anyone with any better more fool proof ways of doing it??

-----Original Message-----
From: Heidi Belal [mailto:[EMAIL PROTECTED]]
Sent: 12 April 2002 23:07
To: CF-Talk
Subject: quotes


Dear All,
I'm facing a problem and can't figure out the solution
and would love anyones help.
the situation is this:
i have a form for users to fill, i take their entry
and enter it in the database, then i take it and
display it in a form so they can edit it.
the problem is this:
if uses enter double quotes my html gets mixed up and
considers the users quote to be the end of the output
value for the input field. 
Example:

<form>
   <input type="text" value="myvalue">
</form>
myvalue is a variable which is read from the DB and
contains a double quote now if 
myvalue = this is a double quote " like this.

the output html will look like this:
<input type="text" value="this is a double quote "
like this.">

and the output like this:
this is a double quote

and that's it..cause it took the double quote as the
end of the value field.

now what do i do?  how can i prevent that from
happing?
Thanks,



=====
Heidi Belal
www.code-corner.com
ICQ# 32127109

A bus stops at a bus station.
A train stops at a train station.  On my desk
I have a work station...

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to