How to interact xfa attribute with javaScript



I want to change text with bold font in javaScript. How can I update <p> with required attribute in javaScript?

<draw x="9.525mm" y="69.85mm" minH="5.08mm">

            <font typeface="Verdana" size="9pt"/>


               <exData contentType="text/html">

                  <body xmlns="" xmlns:xfa=""><p style="text-decoration:none;letter-spacing:0in">Kredia do te perdoret nga<span style="xfa-spacerun:yes"> </span><span style="font-weight:bold">Kredimarresi<span style="xfa-spacerun:yes"> </span></span>per</p></body>






            <margin leftInset="0.5mm" rightInset="0.5mm" topInset="0.5mm" bottomInset="0.5mm"/>

            <para vAlign="middle"/>


Accepted Solutions (1)

Accepted Solutions (1)





You can make some simple changes using span objects, so;

var spans = [];

spans.push({text:"Kredia do te perdoret nga "});

spans.push({text:"Kredimarresi", fontWeight:700});

spans.push({text:" per"});

var xHTML = util.spansToXML(spans);

Text1.value.exData.loadXML(xHTML, false, true);

Would give you something similar to your sample.

There are some other examples Adobe LiveCycle Designer Cookbooks by BR001: xmlToSpans but if you want to use one of the attributes that the span object does not support you could try using E4X (a XML extension for JavaScript) and there's a sample of that Adobe LiveCycle Designer Cookbooks by BR001: Adding values in a form to an email