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"/>
<value>
<exData contentType="text/html">
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><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>
</exData>
</value>
<ui>
<textEdit/>
</ui>
<margin leftInset="0.5mm" rightInset="0.5mm" topInset="0.5mm" bottomInset="0.5mm"/>
<para vAlign="middle"/>
</draw>
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
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
Regards
Bruce
Views
Replies
Total Likes
I am not sure I understand the question. You want to update the <p> tag throughout the document similar to the way you would change CSS?
Views
Replies
Total Likes
Almost right that way. I want to change <p> content and style through form JavaScript. Is it possible?
Views
Replies
Total Likes
Hi,
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
Regards
Bruce
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies