Search code examples
jquerywysiwyg

Dynamic form with wysiwyg issues


I'm having issues with dynamic form with wysiwyg editor. I'm using FCKEditor (I'm forced to).

From the begining, I create a cute form in Fencybox, working correctly. I'm having only one small isssue, form is not sending any value. According to documentation link text everything is implemented correctly.

I'm trying to get editor content by:

var comment = $("#comment").val();

Not working, wondering why. Do you have any suggestions?

Edit alert(comment); return nothing. But when I put in:

success: function(html){
    alert(comment);
}

it works correctly. Any ideas?

Regards, Tom


Solution

  • Use the CKEditor JavaScript API to retrieve the HTML value:

    var comment = FCKeditorAPI.GetInstance('comment_body').GetHTML();