I'm using a database (mysql) called by php. The data is put in the $key variable.
This $key includes some html-code such as <B> or <BR> which I want to show not as <BR> but as html (wysisyg).
I believe the crux is found in this line (see also the code below):
Expand|Select|Wrap|Line Numbers
- textarea1 = document.getElementById('$key');
How do I have to tell ''textarea1'' what the data of $key is in order to show it on the webpage including the <B>, <BR> etc as html (richtext, wysiwyg) ??
i.e.:
Expand|Select|Wrap|Line Numbers
- textarea1 = $row[$key]
[PHP]<font face='trebuchet, arial, HELVETICA' COLOR='$fntclr_1' size='-1'>
".$row[$key]."
<script language='JavaScript' type='text/javascript' src='wyzz/wyzz.js'></script>
<script type='text/javascript'>
function showHTML () {
// ref textarea
textarea1 = document.getElementById('$key');
// where to view HTML code
viewHtml = document.getElementById('div1');
// Finally get HTML output in div
viewHtml.innerHTML = textarea1.value ;
}
</script>
<BR>
<div id='div1' name='div1' style='position:relative;width:350px;height:200px; border:1px solid red;overflow:auto'></div>
<BR>
<input type='button' onclick='showHTML()' value='Voorbeschouwing'>[/PHP]