Ricki Moore
Ricki Moore

Reputation: 1223

How to display input from TinyMCE?

I successfully installed TinyMCE for text editing options for a POST form. When I recieve the text to my database it comes in HTML format. Which is fine. My question is how can I display this input back to my page or another page? To clarify... When I receive the input from the TinyMCE form field it looks like this:

<h1>Help</h1>

However, I want it to look like this:

Help

I see on stackoverflow that it will clean out the HTML tags. How can I do this to my text?

Upvotes: 2

Views: 1086

Answers (2)

Engr Atiq
Engr Atiq

Reputation: 163

Another solution would be to use these tags

echo htmlspecialchars_decode(stripslashes($your_custom_variable));

Upvotes: 0

Ekin
Ekin

Reputation: 1955

See docs: getContent

You don't need to try to get rid of the html tags with php or else. What you should do is while you're on the page use

tinyMCE.activeEditor.selection.getContent({format : 'text'});

to get the content in plain text format and use it accordingly.

You didn't post any code so that's all I can help.

Upvotes: 1

Related Questions