HI! I have something like this in my code:
<html>
<head>
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
oFCKeditor.BasePath = "FCKeditor/" ;
oFCKeditor.ReplaceTextarea() ;
}
</script>
<script type="text/javascript">
function copy(text) { document.getElementById('MyTextarea').value=text; }
</script>
</head>
<body>
<textarea id="test" name="test" > </textarea>
<input type="button" value="Click" name="botao" onclick="copy(test.value);">
<textarea id="MyTextarea" name="MyTextarea"></textarea>
</body>
</html>
But this doesn´t work, the text in "test" textarea is not copy to "MyTextarea" textarea. Any ideas? Thank you.
<html>
<head>
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
oFCKeditor.BasePath = "FCKeditor/" ;
oFCKeditor.ReplaceTextarea() ;
}
</script>
<script type="text/javascript">
function copy(text) { document.getElementById('MyTextarea').value=text; }
</script>
</head>
<body>
<textarea id="test" name="test" > </textarea>
<input type="button" value="Click" name="botao" onclick="copy(test.value);">
<textarea id="MyTextarea" name="MyTextarea"></textarea>
</body>
</html>
But this doesn´t work, the text in "test" textarea is not copy to "MyTextarea" textarea. Any ideas? Thank you.
Re: Copying text from a textarea to FCKeditor
document.getElementById('MyTextarea').value=texto;
just do:
var oEditor = FCKeditorAPI.GetInstance('MyTextarea') ;
oEditor.InsertHtml(text);
Thanks anyway!