We help IT Professionals succeed at work.

Double Quotes problem with Cold Fusion and Text Form Fields

SherryG
SherryG asked
on
Medium Priority
515 Views
Last Modified: 2013-12-24
I am storing data in an Access Database.  In some cases the data contains double quotes.  When I use cold fusion to pull the data into a .cfm page the data displays fine.  However, when I pull the same data into a form field (to allow the user to edit it) the form field only displays the data up to the double quotes.

I need  a way for the user to be able to enter and edit data that may contain double quotes.  I know this can be done, but have not been able to figure it out.

Any suggestions?
Comment
Watch Question

Commented:
User replace function & convert ur double quotes to 2 single quotes & get them displayed properly !

<INPUT TYPE="text" VALUE="<cfoutput>#replace(query.fieldname,'"',"''",'All')#</cfoutput>">

let me know ...

K'Rgds
Anand

Author

Commented:
Am I reading this correctly.

query.fieldname, (single quote)(double quote)(singlequote), (double)(single)(single)(double),'All'

Something does not seem correct.

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
The dreamweaver color coding is not correct.  Almost as if the form field entry is not closed.  But...I tested it and it works.  Thanks for your quick response.

Commented:
way to go !

cheers
Anand

Commented:
Just a note - I realize that you marked this as complete - but this will convert all double quotes to 2 single quotes.  This may cause problems for people editing the content.

I think what you really wanted was this :

<input type="text" name="myfieldname" value="#HTMLEditFormat(query.fieldname)#">

Which will preserve the double quotes so the user can edit the text in an input.

Author

Commented:
Thanks mcichmon that works great!

Commented:
No problem.

I wasn't trying to steal away points, I just thought you might like this answer instead since you aren't changing the data - just allowing it to display correctly.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.