Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to interact xfa attribute with javaScript

Avatar

Avatar
Validate 1
Level 1
greenlnd34
Level 1

Like

1 like

Total Posts

31 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
greenlnd34
Level 1

Like

1 like

Total Posts

31 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
greenlnd34
Level 1

26-03-2015

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>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

26-03-2015

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

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
greenlnd34
Level 1

Like

1 like

Total Posts

31 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
greenlnd34
Level 1

Like

1 like

Total Posts

31 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
greenlnd34
Level 1

26-03-2015

Almost right that way. I want to change <p> content and style through form JavaScript. Is it possible?

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

26-03-2015

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?