Solved

#$%^ Textarea!!!!!

Posted on 2002-07-18
9
171 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
Comment Utility
try

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

Expert Comment

by:CFXPERT
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 17

Expert Comment

by:anandkp
Comment Utility
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
Comment Utility
#Replace("#Replace(                              "#Replace(
                                        JSStringFormat(HTMLEditformat(form.txtMessage)),
                                        "\n", "<br>","All")#",
                                        "\\","\","All")#",
                                        "\'","'","All")#
0
 

Author Comment

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

Expert Comment

by:dash420
Comment Utility
Thanks
0
 

Expert Comment

by:dahirsh
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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 discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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