4

I am trying to implement tinyMCE's BBCode plugin but not being able to make it work. This is the init code:

$(textarea).tinymce({
    script_url : '/js/tiny_mce/tiny_mce.js',
    theme : "advanced",
    plugins : "bbcode",
    theme_advanced_buttons1 : "bold,italic,underline,forecolor,|,undo,redo,link,unlink,|,removeformat,cleanup",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
    entity_encoding : "raw",
    remove_linebreaks : false,
    forced_root_block : false,
    force_br_newlines : true,
    force_p_newlines : false,    
    convert_newlines_to_brs : true,
    remove_redundant_brs : false,
    width: '700px',
    height: '250px'
});

The thing is that when I submit the form, HTML tags are being posted instead of BBCode. If I try tinyMCE.activeEditor.getContent() on the console, it brings BBCode.

I'm using an input[type=submit] to send the form (without any JS attached to it).

Why am I not getting BBCode posted?

Gerardo
  • 1,928
  • 4
  • 24
  • 34

1 Answers1

0

Try passing the textarea content by a htmlentities function before sending it to the file that will handle the data!

Afonso Gomes
  • 902
  • 1
  • 14
  • 40