Feeling a bit dumb because I just got this working on a complicated site, but I am missing one piece. The characters are all stored in encoded format such as > or <
How do I get this to display correctly in IE/Netscape when I pull it back out from my database? I messed with encodings, etc, but didn't know the correct method.
The rest of my page is non-strict HTML 4.0 but not encoded.
Do I need to wrap my text output in a javascript function that changes it back into non-encoded HTML?
Please give me examples if possible on how you do this.
Thank you so much.
JohnE
How do I get this to display correctly in IE/Netscape when I pull it back out from my database? I messed with encodings, etc, but didn't know the correct method.
The rest of my page is non-strict HTML 4.0 but not encoded.
Do I need to wrap my text output in a javascript function that changes it back into non-encoded HTML?
Please give me examples if possible on how you do this.
Thank you so much.
JohnE
RE: display output in browsers
In file sampleposteddata.asp included in the package copy this lines overwriting the existing one:
<% For Each sForm in Request.Form %>
<tr>
<td valign="top" nowrap><b><%=sForm></b></td>
<td width="100%"><%=Request.Form(sForm)%></td>
</tr>
<% Next %>
And get the text, images and so on you entered in the editor.
Cristian
RE: display output in browsers
I am using Velocity templating and not ASP.
I had been trying to work off the HTML example, but have not gotten it to work. Also it prints it out as "<"s and ">"s rather then in HTML format. Here was the example code:
<!--
function HTMLEncode( text )
{
text = text.replace(/&/g, "&") ;
text = text.replace(/"/g, """) ;
text = text.replace(/</g, "<") ;
text = text.replace(/>/g, ">") ;
text = text.replace(/'/g, "’") ;
return text ;
}
var aParams = document.location.search.substr(1).split('&') ;
for ( i = 0 ; i < aParams.length ; i++ )
{
var aParam = aParams[i].split('=') ;
var sParamName = aParam[0] ;
var sParamValue = aParam[1] ;
document.write( '<tr>' ) ;
document.write( '<td valign="top" nowrap><b>' + sParamName + '</b></td>' ) ;
document.write( '<td width="100%">' + HTMLEncode( unescape( sParamValue.replace( /\+/g, ' ' ) ) ) + '</td>' ) ;
document.write( '</tr>' ) ;
}
//-->
Also I have like 8 fields on one page I need to display on a results page and was hoping to have it as a function. Anybody done this for HTML? I am not a javascript programmer so wishing there was a good example of a function taking the encoded text and giving output so that browsers will display it as a web page. Is there a particular encoding I should be using?
RE: display output in browsers
RE: display output in browsers
</li></ol><ul><li>ability to track and report on licensing analyst comments and</li><li> requirements. * Solely responsible for maintenance and </li><li>
When I use this code:
function HTMLEncode( text )
{
if ( typeof( text ) != "string" )
text = text.toString() ;
text = text.replace(/&/g, "&") ;
text = text.replace(/"/g, """) ;
text = text.replace(/</g, "<") ;
text = text.replace(/>/g, ">") ;
text = text.replace(/'/g, "’") ;
return text ;
}
function displayTextField( richText )
{
document.write( HTMLEncode( richText ) ) ;
}
When I use this encoding:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
If you see anything that I can do to make the HTML come out using Velocity templating, I hope this helps somebody with understanding pick up my mistake.
RE: display output in browsers
Right now using a simple <span>text area output</span>
I am getting:
<p><strong>Ok lets keep trying this crap</strong></p><p><strong>Not sure why it is chopping my code off.</strong></p><p><strong/></p>
looking code to the ending HTML screen. I want it to look the part not have tags showing. No clue.
RE: display output in browsers