carriage return in popup window is gone

Posted on 2001-09-11
Last Modified: 2008-03-03
I use JS popup window in cold fusion page.
when i click the text link, the notes shown up in popup window, all the carriage returns are gone.
when i use
"select notes from stunotes"
in SQL query analyzer, the carriage returns are there.

Any idea is highly appreciated. Thanks.

Question by:wj53
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Accepted Solution

FranzRinkleff earned 60 total points
ID: 6474911
not sure if i fully understand your problem.

but this it what is sounds like to me.  

you have a cold fusion page.
you have a query and the results of the query is text with carriage returns
it has a link that when clicked a javascript function opens a new window.  
the new window displays the results of your query.  however, the carriage returns are not being shown in the new window.  

The reason you do not see the carriage returns in the new window is because blank spaces are not recognized in html.
the following would look the same <h3>Hello World</h3> and
<h3>Hello        World</h3>  Cut and paste them to see.  Carriage returns are also not recognized by HTML.

So you have to choices.  

You could use the Replace function in SQL to replace all of your carriage returns with <BR>.  The <BR> html element would then cause new lines to appear.

Or you could create an html <textarea> like this
<textarea name="textBoxDesc#eventCounter#" rows="5" cols="100">#textbox_desc#</textarea>

where #textbox_desc# is the result of your query.  since the result of the query is part of the textarea the carriage returns will be shown.  


Author Comment

ID: 6474975
Hi FranzRinkleff ,
you understand it correctly. That's exactly what the problem is.
I will try the <textarea> first. if I draw the textarea the same size as the window, it seems like it should fit the window.

Author Comment

ID: 6475162
in the textarea the carriage return is taken care of automaticlly. But after i add the textarea in "popnote.cfm", it looks not pretty at all. Outer layer is popup window, inside is iframe, inside is textarea. I know little knowledge about JS. do you how to get rid of iframe and only leave textarea in the window? Thanks.

function showPopupWindow(url, top, left, width, height) {

newwin.document.write('<iframe width='+(width-10) +' height='+(height-50)+' src='+url+'></iframe>')
newwin.document.write('<br><center><a href="#" onClick ="window.close();return false;">')
newwin.document.write('<img src="images/close.gif" border="0"></a></center>')

<a href=""
onClick="JavaScript:showPopupWindow(this.href,100,100,500,600); return false">#Trim(smallnote)#&nbsp;</a>

<cfoutput query="FULLNOTE">
<textarea name="textBoxDesc" rows="25" cols="38">#note#</textarea>



Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.


Author Comment

ID: 6476867
I find out if i use textarea in the popup window, it's a temptation to add something or modifiy it there. Eventhough any modification is discarded, i think i have to SQl solution.

the note is saved as text data type. how to add chr(13) for each carriage return?

Author Comment

ID: 6477731
I went to SQL forum and found answer to replace this trick text date type with <BR>.
If anyone is interested in the answer, pls go

FranzRinkleff, i will pass my points to you in a few days. Just don't like to see my points decrease too much in a day. :-)


Expert Comment

ID: 6772816
On 9/21/01 you said that you would pass ponts to FranzRinkleff in a few days, but have not done so yet.  Please do, accept his comments and convert it to the Accepted Answer to then grade and close this (A grade, I hope.  Anytime you choose to grade with less than an A grade, it is important to tell the experts why.  They take great pride in providing excellent support).

Community Support Moderator @ Experts Exchange

Expert Comment

ID: 6778253
Community Support Moderator @ Experts Exchange

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery driving me nuts... 14 28
null, truthy, falsey confusion 25 33
Calculating percentage 2 32
REST call Failing 1 15
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 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