• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Replace Typed Dashes in Paragraph with HTML

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
champ_010
Asked:
champ_010
  • 2
1 Solution
 
pinaldaveCommented:
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
 
anandkpCommented:
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
 
champ_010Author Commented:
Thanks--learned something new again.
0
 
pinaldaveCommented:
I learn everytime from AnandKP :)
---Pinal
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now