How can I get value of textarea using js ?
fck.value doesn't work....
<textarea id="CONTENT" name="CONTENT" class="bigger">$CONTENT</textarea> <script type="text/javascript"> var fck = new FCKeditor( 'CONTENT', 1000, 280 ); fck.BasePath = 'inc/fck/'; fck.ToolbarSet = 'Default'; fck.ReplaceTextarea() ; </script>
fck.value doesn't work....
Re: fck.value ?
Using document.getElementById(' ').value doesn't work.....
Re: fck.value ?
Re: fck.value ?
Yes use the API commands, see http://docs.fckeditor.net/FCKeditor_2.x ... Script_API
Re: fck.value ?
You can use the FCKEditor API in javascript like forexample
function fnGetText(CircularText)
{
var oEditor = FCKeditorAPI.GetInstance('<%=txtText_Circular.ClientID %>') ;
oEditor.EditorDocument.body.innerHTML=CircularText;
hidField.Value = oEditor.EditorDocument.body.innerHTML;
}
This will insert the Text in the FCK Editor and if you want this text to get in a Hidden Field you can get that like shown.
The function has been called on click of the anchor passing in the text for the FCKEditor.
oR another way is using this:
var e = $.fck.list;
var ta = e[0].textarea;
var ht = $.fck.content(e[0].InstanceName);
ta.val(ht).filter('textarea').text(ht);
ta.val() gives you the text.
Cheers
Re: fck.value ?
Hmmm akhanna, you better use the API functions GetData en SetData I believe...
There's also the commands editorInstance.GetLinkedFieldValue and editorInstance.UpdateLinkedField (see more at viewtopic.php?f=6&t=12098), but never used them and not sure what they do
Re: fck.value ?
Thanks for the valuable Suggestion.
Regards