Pass text from n2:freetextarea to controller, mvc

Jun 26, 2013 at 5:21 PM
Hi!

I put <n2:FreeTextArea> on a page but I dont know how to pass the text to my controller. What i want is users to write messages that look good, so i need a rich textbox not just plain text.
Problem is I cant seem to name the FreeTextArea and therefore it wont pass with my other inputs in my form to the controller.

Is there any way i can solve this?
Coordinator
Jun 27, 2013 at 12:01 PM

This would be a great article to add to the documentation wiki if anyone knows how it could be done :-\

Jun 30, 2013 at 7:49 PM
I did it with this code, if anyone runs in to the same trouble i had:
    $('#buttonID').click(function () {
        $.ajax({
            type: "POST",
            url: "/controllername/methodname",
            conentType: "application/json; charset=utf-8",
            data: { variable: $("iframe").contents().find("body").html() },
            dataType: "json",
        });
This will get the entire body of the first iframe (tinymce window is an iframe), tags and all! (or will it get all iframes? Im not too good at jquery ... )
'variable' is the name of input in your method, if you have several inputs then you seperate them with commas.