Hi,
I am using the JavaScript FCK package 2.6.4. Here is my code I used to integrate the editor in my form.
************************************************************************************************************************
<textarea rows="5" cols="53" name="story"> </textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'story') ;
oFCKeditor.BasePath = "/fckeditor/" ;
oFCKeditor.ToolbarSet = ''story'';
oFCKeditor.ReplaceTextarea() ;
</script>
************************************************************************************************************************
While submitting the form I am using document.form[0].story.value to get the value from the editor, but it always returns an empty string. Please suggest me how to get the editor text in this code
I am using the JavaScript FCK package 2.6.4. Here is my code I used to integrate the editor in my form.
************************************************************************************************************************
<textarea rows="5" cols="53" name="story"> </textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'story') ;
oFCKeditor.BasePath = "/fckeditor/" ;
oFCKeditor.ToolbarSet = ''story'';
oFCKeditor.ReplaceTextarea() ;
</script>
************************************************************************************************************************
While submitting the form I am using document.form[0].story.value to get the value from the editor, but it always returns an empty string. Please suggest me how to get the editor text in this code
Re: Problem in getting the textarea value
it should be document.forms[0].story.value (note the 's' on forms)
also, make sure the id is set to story for the textbox
hope this helps
Re: Problem in getting the textarea value
Now I am using the form name like document.myform.story.value.
The value is getting submitted also, but it is not available to the javascript in the same page.
For example:
On click of the submit button, I am calling a method which is having alert(document.myform.story.value).
But the alert msg is always showing an empty string.
So please tell me how to get the text entered in the editor in a javascript function.
Thanks,
Anand
Re: Problem in getting the textarea value
Make sure you got a name and id attribute on the form...and check the CaSe for the id's since Javascript is CaSe SeNsItIvE.
Hope this helps
Re: Problem in getting the textarea value
I am using IE6.
Re: Problem in getting the textarea value
Re: Problem in getting the textarea value
Unless I am not understanding the issue here. If that is not the value you are expecting, then by all means explain exactly what you want and I will try and help.
Re: Problem in getting the textarea value
But the alert message is only showing "<p>Initial Value</p>" which is the actual initial value.
Is this is clear now?please look into the image
Attachments:
Re: Problem in getting the textarea value
Ok, sorry, I should have tested it a bit better.
This seems to do the trick. In that same code, replace this method:
Re: Problem in getting the textarea value
Thanks a lot for your time.
Re: Problem in getting the textarea value
NP, glad we got it sorted