close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Populating initial value using jquery

Thread began 3/11/2012 6:12 pm by matt360561 | Last modified 3/13/2012 3:15 pm by Jason Byrnes | 915 views | 3 replies |

matt360561

Populating initial value using jquery

Hi

I'm working on an edit screen on the webapp which uses HTML Editor. I want to populate the htmleditor with an initial value suppled via a backend script using ajax.

I've tried using $('#article').val(d.data[0].article); and this works fine for other areas and text areas but not the HTMLEditor.

Any advice, greatly appreciated.

Thanks

Matt

Sign in to reply to this post

Jason ByrnesWebAssist

you need to use the CKEditor setData function for this:

CKEDITOR.editor.html#setData

Sign in to reply to this post

matt360561

Thanks Jason.

I've tried using the following for my html editor instance which is named article:

CKEDITOR.instances.article.setData( '<p>This is the editor data.</p>' );

But this doesn't seem to work. Please could you give me an example? I forgot to mention the version of HTMLEditor I have is version 2 (if that makes any difference)

Many thanks

Sign in to reply to this post

Jason ByrnesWebAssist

html editor 2 make a big difference.

try using this javascript code:
<script type="text/javascript">
window.onload = function() {
var oEditor = FCKeditorAPI.GetInstance('article') ;
oEditor.SetData( '<p>This is the editor data.</p>' );
};
</script>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...