Hi everyone
In Adobe Live Cycle Designer ES4, I have a text field named "TEXT" (option "Allow Multiple Lines" activated). It is binded to a string field of an ABAP structure.
I want to change certain parts of the text field to bold. They are already marked with "\b" for the starting point and "\b0" for the ending point.
How is that possible? I am not good with Javascript :(
TEXT.font.weight = "bold" works for me, the complete field changes to bold. But how can I change certain parts of the text field?
Thanks a lot in advance for any help!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
not so easy because you need to write the whole XHTML shebang into the exData section.
Make sure your TextField is of type Richtext!
Initialize event of the field:
var envelope = "<?xml version='1.0' encoding='UTF-8'?>" +
"<exData contentType='text/html' xmlns='http://www.xfa.org/schema/xfa-template/2.8/'" +
"><body xmlns='http://www.w3.org/1999/xhtml' xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/' " +
"xfa:APIVersion='Acroform:2.7.0.0' xfa:spec='2.1'>" +
"<p> test <b>BOLD</b> test</p></body></exData>";
this.value.exData.loadXML(envelope,1,1)
result:
Hi @sukram87,
Could you please raise this query in Forms Community - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/ct-p/adobe-experienc...
Here are some useful tricks if the text field is having Rich text data.
You can refer to the sample form shared with the blog for more insight on the implementation.
Hope this helps!
Hi PulkitJain
Thank you!
Unfortunately, it does not work. I know this article and tried it previously but without success:
The field format is "Rich Text". What is wrong?
Views
Replies
Total Likes
Hi,
not so easy because you need to write the whole XHTML shebang into the exData section.
Make sure your TextField is of type Richtext!
Initialize event of the field:
var envelope = "<?xml version='1.0' encoding='UTF-8'?>" +
"<exData contentType='text/html' xmlns='http://www.xfa.org/schema/xfa-template/2.8/'" +
"><body xmlns='http://www.w3.org/1999/xhtml' xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/' " +
"xfa:APIVersion='Acroform:2.7.0.0' xfa:spec='2.1'>" +
"<p> test <b>BOLD</b> test</p></body></exData>";
this.value.exData.loadXML(envelope,1,1)
result:
Hi Kosta,
thank you, that works fine
I can start a new line in my text field by adding <p> and </p>. But I cant add a complete free line.
How can I do that?
Thanks again!
Views
Replies
Total Likes
Did you try <br/> ? Use two that should give you a newline - and make your text field multi-line
Views
Replies
Total Likes
Hi,
this is very nice post. But I would need go a bit deeper. I am not a coder in Javascript, so I am not sure how to achieve this.
When I use this example, it works fine. But I would like to have "<p> test <b>BOLD</b> test</p>" replaced by text field from binding in form.
I am able to prepare variable and put there formatting tags, but I do not know, how to place it in form them. Please, advise.
Thank you,
david
Hello.
I have the same problem. Could you let me know if you found any solution?
Thank you,
Ramona
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies