Hello, everyone.
I am using JavaScript to replace line breaks from a textarea with "<br />" before submitting the form, and that part is working flawlessly.
Where I'm having an issue is trying to replace the "<br />" with chr(13) & chr(10) in the data pulled from the database when trying to edit the value. I'm using REreplaceNoCase() but I'm not sure how to tell the CF RegEx engine what to look for.
Here is what I'm using to insert the line breaks for HTML:
document.formName.fieldName.value = document.formName.fieldName.value.replace(/(\r\n|\r|\n)/g,"<br />");
Here is how I'm attempting to reformat for editing inside the textarea:
#REreplaceNoCase(qry.columnName,"<br />",chr(13) & chr(10),"all")#
But the REreplaceNoCase isn't finding any of the "<br />" that is in the value. How should the RegEx be formatted to find the "<br />"?
Respectfully,
^_^
I have a habit of just automatically going for the RegEx solution, whenever possible. Switching to ReplaceNoCase() didn't immediately correct the issue.
Turns out that the "<br />", without my immediately realizing it, was being inserted into the database as "<br />". Once I figured that out, the suggestion of using ReplaceNoCase() worked.
Thank you, guys.
^_^
North America
Europe, Middle East and Africa
Asia Pacific