This topic is locked
[SOLVED]

 HTML Text Area: pop up view on Subject field

3/4/2009 12:03:35 PM
ASPRunnerPro General questions
L
lnemer author

Hello!
Is there any way to have the content in a field that contains HTML text to pop up (or text link) from a different field on the LIST page?
This application has a messaging section but the HTML fields will not truncate on the List page to show previews. However. I need to show or link to a pop up with the HTML message from the LIST page without using the edit or view links.
How can I show the full message or preview of HTML message body with either a mouse-over or clicking a text link (in the Subject field) to pop up a small window with either all or a portion of the message body field on the LIST page?
Thanks in advance for your help!

Odie

J
Jane 3/5/2009

Odie,
use custom format on the "View as" settings dialog on the Visual Editor tab for this purpose.

Here is a sample:

custom_text = my_htmlspecialchars(rs("HTMLFieldName"))

str = " <a href=""#"" onClick=""java script: pwin = window.open('',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');"

str = str & "pwin.document.write('" & my_htmlspecialchars(jsreplace(Replace(Mid(custom_text, 1, 801), vbcrlf, "
"))) & "');"

str=str & "pwin.document.write('
<hr size=1 noshade><a href=# onClick=\'window.close();return false;\'>Close window</a>');"

str=str & "return false;"">" & strValue & "</a>"
strValue = str

L
lnemer author 3/5/2009

Hi Jane

Please pardon my lack of knowledge to get this to work. I know I am missing something obvious. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=38636&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> Please help.
[codebox]custom_text = my_htmlspecialchars(rs("Message_Body"))

str = " <a href=""#"" onClick=""java script: pwin = window.open('',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');"

str = str & "pwin.document.write('" & my_htmlspecialchars(jsreplace(Replace(Mid(custom_text, 1, 801), vbcrlf, "
"))) & "');"

str=str & "pwin.document.write('
<hr size=1 noshade><a href=# onClick=\'window.close();return false;\'>Close window</a>');"

str=str & "return false;"">" & strValue & "</a>"
strValue = str[/codebox]
When I use the above code the list page loads fine and the link on the Subject field looks ok until clicked on. It does not open a small window with the Message_Body. Nothing happens. It just clicks.
But then when I use the following code the link goes to a blank page in the same window.
[codebox]custom_text = my_htmlspecialchars(rs("Message_Body"))

str = " <a href=""Admin_Message_PopUp.asp"" onClick=""java script: pwin = window.open('',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');"

str = str & "pwin.document.write('" & my_htmlspecialchars(jsreplace(Replace(Mid(custom_text, 1, 801), vbcrlf, "
"))) & "');"

str=str & "pwin.document.write('
<hr size=1 noshade><a href=# onClick=\'window.close();return false;\'>Close window</a>');"

str=str & "return false;"">" & strValue & "a>"

strValue = str

[/codebox]
What am I doing wrong?
Thanks!

J
Jane 3/6/2009

Hi.
please make sure there is no whitespace between java and script in your code:

onClick=""javascript: pwin = window.open('',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');"

L
lnemer author 3/6/2009

Hi Jane,
Thank you, that almost did the trick...

However, now the pop up box appears but so do the text formatting tags. The message text is orginally added/edited using the Innova Editor plug in. The code now actually strips the HTML which is okay (thought it would be better if HTML) but the text formatting tags show up on the pop up page.
[codebox]custom_text = my_htmlspecialchars(rs("Message_Body"))

str = " <a href=""#"" onClick=""java script: pwin = window.open('',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');"

str = str & "pwin.document.write('" & my_htmlspecialchars(jsreplace(Replace(Mid(custom_text, 1, 801), vbcrlf, "
"))) & "');"

str=str & "pwin.document.write('
<hr size=1 noshade><a href=# onClick=\'window.close();return false;\'>Close window</a>');"

str=str & "return false;"">" & strValue & "</a>"
strValue = str[/codebox]
This is what is rendered in the pop-up box:

<H3><SPAN style="FONT-SIZE: 10pt; COLOR: #0000cd; FONT-FAMILY: Lucida Sans">This is a test of the Amber Alert Admin Messaging Module</SPAN></H3><SPAN style="FONT-SIZE: 8pt; COLOR: #0000cd; FONT-FAMILY: Lucida Sans">

<UL>

<LI>

<H3><SPAN style="FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Lucida Sans">This is a test of the Amber Alert Admin Messaging Module</SPAN></H3></LI>

<LI>

<H3><SPAN style="FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Lucida Sans">

<H3><SPAN style="FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Lucida Sans">This is a test of the Amber Alert Admin Messaging Module</SPAN></H3></SPAN></H3></LI&
What am I missing?
Almost there,

Odie

J
Jane 3/10/2009

Odie,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

R
rsking 3/13/2009

Hey Odie... here's what I did:
Using the visual editor wrap the html field in a DIV with a fixed height and width and allow scrolling within the DIV. That way you can see all of the entry, but it doesn't blow out your list. Here's the code I used for a field called "description":
<DIV style="BORDER-RIGHT: #ff0000 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ff0000 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; OVERFLOW: auto; BORDER-LEFT: #ff0000 1px solid; WIDTH: 200px; PADDING-TOP: 4px; BORDER-BOTTOM: #ff0000 1px solid; HEIGHT: 100px">{$description_value}</DIV>
Works like a charm!

L
lnemer author 3/16/2009

Thanks King ... you said it works like a charm and it does!