Using HTML tags in value attribute of xf:output

146 Views Asked by At

I need to change the value of xf:output element dynamically based on another input field. For this I'm using concat method and setting the value attribute like this

value="concat('The price is ', instance('fr-form-instance')/section-1/my-price, ' euros.')"

where my-price is the control where the user can enter some amount which I want to display in the output control.

As a result I would get something like this "The price is 100 euros.", but now I should add some styling to one part of this sentence e.g. "The price is 100 euros.". Is it possible to use html tags within the value attribute of output control, or is there any other way to implement this?

1

There are 1 best solutions below

0
On

You can write the following:

<xf:output
    mediatype="text/html"
    value="
        concat(
            'The price is &lt;b&gt;',
            100,
            '&lt;/b&gt; euros.'
        )
"/>