views:

28

answers:

1

Hey guys What I want to achieve is the following;

I have a textarea filled with text in our CMS. That text contains some special strings that are variable names. In the site these variables are replaced with something else (e.g "$!test;" will be replaced with "Hello this is a test").

Now I want to prevent the users from editing these strings in the textarea, but making the whole textarea disabled or readonly ofcourse has no use.

I was hoping that maybe there are some ways to do this, even if I need a WYSIWYG editor like TinyMCE or CKEditor.

Thanks in advance guys

Cheers! Maikel

+2  A: 

CKEditor has the protectedSource property:

List of regular expressions to be executed over the input HTML, indicating code that must stay untouched.

I can't guarantee it will preserve the elements in a visually appealing way, but it definitely is worth a look.

Pekka
We looked into this and found a way to make it work as we like.Thanks a lot!Cheers!
Eggie