Highlighted

How to bold a one word in a textfield

Aditya_S_

05-01-2009

I would like to bold a few randomn words in a sentence used as a rawvalue in a textfield.



e.g. "This
word should be bold"



Does someone know how to acheive the above through scripting



Thank you in advance



Aditya

Replies

Niall_O_Donovan

08-01-2009

Hi Aditya,



I am not sure if this is much help to you. I do not know how to script what you are looking for.



However you can change the field format for each of the textfields. In LC Designer 8.2 select the textfield and go to the Object / Field window. Then change the Field Format from "Plain Text Only" to "Rich Text". When using the PDF form, you can change the format of the whole textfield or individual words. For example "Control + B" will give you bold text, "Control + U"; underline, "Control + I"; italic. When a field is active you can press "Control + E" and this will allow you to change the font type and size, etc.



If you are using an earlier version of LC Designer, then you have to make two changes in the Object window. From memory one is in the Field tab and the other in the Binding tab.



Good luck,



Niall
Highlighted

AJP256

28-07-2009

I'm having the same issue.  I'd like to have a single word bolded, and I need to accomplish this using a script.  I can find references online to a JavaScript bold method, but I'm at a loss as to how it is applied in LiveCycle.  Anyone have any ideas?

Highlighted

parth_pandya

28-07-2009

Hi Guys,

I wrote a blog entry on how to do this. It's basically around how to set rich text content into a field. This is little tricky and all of the info that you need can be found at

http://blog.pandyaparth.com/?p=65

There is a sample there as well to help you guys.

regards,

Parth Pandya

http://blog.pandyaparth.com

Highlighted

AJP256

29-07-2009

Thanks for your help!  It looks like this will do what I need.  Question-is it necessary to import the XML data from somewhere else?  I've cut down the script so the only part I'm using is

txtOutput2.value.exData.loadXML(exdataTemplate.rawValue,1,1);

but I'd prefer it if I didn't have to have a text field floating around my form for the sole purpose of holding XML data.  Is it possible to put the XML data in the script editor and get it to work?  Is some command other than loadXML necessary?  Thanks

Highlighted

mcapsi

21-08-2013

Hi parth pandya and all:

I was able to do this; however, how do I add a tab to my text?  I tried   but it didn't work.  Thanks.

Mike

Edit:

Figured it out, just used javascript on form ready,

  1. this.para.textIndent="50px";
Highlighted

Karwan_Mawlood

24-07-2016

This only will make it move to right by 50 pxl , if it is zero then the text is in the center (i.e) it is text alignment not style