Solved

#$%^ Textarea!!!!!

Posted on 2002-07-18
9
173 Views
Last Modified: 2013-12-24
How do I get the text area to recognize the [enter]
and display it when it returns just as it was put in.

I have tried <cfoutput>#paragraphformat#</cfoutput>
but to no avail.


any help would be great
0
Comment
Question by:jriver12
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7163367
try

<pre><cfoutput>#variable Name#</cfoutput></pre>
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7163393
just make sure you put the <pre> tag outside the <textarea> tag. like

<pre>
<textarea cols=40 row=4><cfoutput>#varName#</cfoutput></textarea>
</pre>
0
 

Author Comment

by:jriver12
ID: 7163562
Its still not formating.

the data is going into the db from the <pre><textarea></textarea></pre>

then I am recalling it like
<Pre><cfoutput>#paragraphformat(listingtext)#</cfoutput></pre>

still not recognizing the hard returns.

help


0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7163861
in your DB, what is the datatype of your column?
also loose the #paragraphformat#.  

If you query a column that has /n or chr(13) characters.
the <pre> tag will preserve those non-printable charcters.


Can you post your insert code as well as your query and output code.
0
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.

 
LVL 17

Expert Comment

by:anandkp
ID: 7164041
hi,

i'll give u a scrpit u can use this.

this script will add <br> for each enter key used in textarea.

then it will go inside the DB as

text<br>text .... <br> ....

so when u want to dislpay this - u can use
replace(#data#,'<br>',"''",'All')

so that it comes in proper formatting ... the pre tags wont help much ... as u can never be sure abt them.

let me know ... heres the script :

==========================================================
var span1=new RegExp("[\\n]","g");
var rep1=sContVal.replace(span1,"<BR>");
document.FormName.Controlname.value = rep1;
==========================================================

call this javascript before submitting the form. thats all !!!

K'rgds,
Anand
0
 
LVL 6

Accepted Solution

by:
dash420 earned 100 total points
ID: 7164212
#Replace("#Replace(                              "#Replace(
                                        JSStringFormat(HTMLEditformat(form.txtMessage)),
                                        "\n", "<br>","All")#",
                                        "\\","\","All")#",
                                        "\'","'","All")#
0
 

Author Comment

by:jriver12
ID: 7165414
thank you very much all for the help and pointers..
0
 
LVL 6

Expert Comment

by:dash420
ID: 7166244
Thanks
0
 

Expert Comment

by:dahirsh
ID: 12884333
anandkp , can you give more details into how to use

i'll give u a scrpit u can use this.

this script will add <br> for each enter key used in textarea.

then it will go inside the DB as

text<br>text .... <br> ....

so when u want to dislpay this - u can use
replace(#data#,'<br>',"''",'All')

so that it comes in proper formatting ... the pre tags wont help much ... as u can never be sure abt them.

let me know ... heres the script :

==========================================================
var span1=new RegExp("[\\n]","g");
var rep1=sContVal.replace(span1,"<BR>");
document.FormName.Controlname.value = rep1;
==========================================================

call this javascript before submitting the form. thats all !!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

10 Experts available now in Live!

Get 1:1 Help Now