Highlight part of text in a text field

Highlight part of text in a text field


Hi Guys,

I have a text field that reads from the database a long text field. I want to highlight parts of it (in any way, change colour, bould etc.) For instance, if it contains "This house belongs to John Smith", I want to highlight the word house, lets say in red and bold.

How can I do this?

I would suggest that you do a bit of parsing on your text, before you display it on your screen as an unescaped expression. You should wrap the words you want to highlight in <span> tags, assigning them a CSS class that gets you the intended highlight look.

You can use the Replace or function to wrap specific words or expressions, or you can use the Text extension's Regex_Replace if you need to match some generic pattern.

Hi Joao,
There's an Jquery plugin which get's you the requested result:
Maybe this will help you achieve your goal :)