Showing text edited in a WYSIWYG

Hello,

Im using a HTML Input - WYSIWYG control. I want to show on a view the text I’m typing down in this control.

I’ve found a way of doing it:

create a blockPanel and then use javascript to fill in the blockpanel with the text found inside the HTML input, the script is as follows:

$(’#{activePageBean.clientIds[‘BLOCKPANEL’]}’).innerHTML = ‘#{view.text}’;

The problem I’m having is that this works correctly only if there is no change line (enter key pressed) inside the HTML input.

Any ideias of a different way of showing html text?

I’ve already tried using a Formated text control but it does not preserves HTML tags… the message is shown like this:

Mensagem4

Instead of showing Mensagem4 in red.

What happens when the user clicks the enter button?

You can use the Output Text control to render your html markup value. Just set the ‘Escape’ property to false so it doesn’t encode all of your html tags.

Thank you Eric. That worked just fine :slight_smile: