Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Format Lost...

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Sep 26, 2001
1,605
US
I Have an html textarea that users input text descriptions of a problem into (much like this box I am typing in now.)

I am using <cfform method=&quot;post&quot; action=&quot;index.cfm&quot;> to send my data to the action page, which is a verification page. The text shows up fine on the verification page Using paragraphformat. all the line breaks and quotes are ok. Then the text is passed through <input type=hidden> to the next page and is saved in the database (longchar).
When the text is looked up from the database and displayed again using paragraphformat, it stops at the first double quote &quot; not showing the &quot; or anything after.

I have another area of the site that goes from form to database the exact same way, except that this time there is no verification screen, an no passing hidden input forms, and it works how it should, showing quotes and everything.

any suggestions? the data in the database is not being saved correct, (thats why its not displayed correct), but why?
 
you can use HTMLEditFormat() function to escape all the <>&quot; characters and make it safe to display in HTML page Sylvano
dsylvano@hotmail.com
 
You need to escape your quotes when you put the data in the database. The SQL processor is choking on them, thinking you've reached the end of the string.
 
thanks. I had been using htmleditformat on the DB insert, I added it to the hidden form input as part of the value and it seemd to work now.

Thanks
 
you can also use this to prepare all the form fields for SQL processing:

<cfloop collection=&quot;#form#&quot; item=&quot;i&quot;>
<cfscript>
&quot;form.#i#&quot; = HTMLEditFormat(Trim(Evaluate(&quot;form.#i#&quot;)));
</cfscript>
</cfloop> Sylvano
dsylvano@hotmail.com
 
aahhh.... why don't I think of this stuff????

thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top