Hello,
I need to change the default style of my WYSIWYG. How do I do it? I am using execCommand for my WYSIWYG.
See:

The upper is the editor and the lower one is how it looks in the website. In the lower (website) it looks how it should be, all colors and so on, but in the editor it is using default Times New Roman or Arial or something as a font and default black color. I would like to apply the same styles.css of my website to this WYSIWYG editor.
This is my main WYSIWYG code:
Code:
<script language="JavaScript">
var Editor;
function Format(action)
{Editor.execCommand(action, false, null);}
function Colour(colour)
{Editor.execCommand("forecolor", false, colour);}
function Font(fontname)
{Editor.execCommand("fontname", false, fontname);}
function InsertHTML(html)
{Editor.execCommand("inserthtml",false,html);}
window.onload = function()
{
Editor = document.getElementById('textbox').contentWindow.document;
Editor.designMode = "on";
Editor.body.innerHTML = '$p_text';
document.forms[0].onsubmit = function()
{
var text = document.getElementById('text');
text.value = Editor.body.innerHTML;
}
}
</script>
Please any help is appreciated!
|