Solved

Replace Typed Dashes in Paragraph with HTML

Posted on 2004-09-18
4
208 Views
Last Modified: 2013-12-24
Hi I have this in my Sql UPDATE statement:

Description='#Replace(form.Description, chr(13) & chr(10), "<br>","ALL",)#'

so that I can replace carriage returns in my <textarea> with <br> for input into the database.  I would also like to replace all dashes (-) typed into the textarea with the proper thing so that I won't get a little square in the paragraph on output.  How? I should mention these are not regular dashes but are the long ones--I don't know what they are called.
0
Comment
Question by:champ_010
  • 2
4 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 12095714
okey they may be combination of many dashes... in world when there are two or three dashes toghether looks like big horizontal dashes... so you need to replace them with many dashes...
Tha ascii of dash will be &#150;
if due to some reason they are big dash then try this big dash ascii &#151;
hope this helps...
Regards,
---Pinal
0
 
LVL 17

Accepted Solution

by:
anandkp earned 100 total points
ID: 12099526
Why not use CFQueryParam to insert the text entered in textarea ... it shld allow u to insert things as entered by the user ...

UR Sql UPDATE statement wld be like :
Description = <CFQueryParam CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#form.Description#">

lemme know if this helps ...
0
 
LVL 1

Author Comment

by:champ_010
ID: 12114709
Thanks--learned something new again.
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 12115054
I learn everytime from AnandKP :)
---Pinal
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now