These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Making bold a calculated field through script(JavaScript)

abrob
Registered: Aug 15 2010
Posts: 8

I would like to make bold a calculated decimal field when it reaches 100 for instance.I used this script in my IF statement this.caption.font.weight = "bold" but no success.Any idea?

Abrob

My Product Information:
LiveCycle Designer, Windows
Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

As far as I know, to make effect of the changes to a visual in realtime, you'll need to save the file as "Dynamic XML Form".
abrob
Registered: Aug 15 2010
Posts: 8
HI Bamboolian

My file is saved as Dynamic XML form and nothing has changed

Abrob

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

here an example to change the font weight depending on a fields calculation.
This is FormCalc, put it into the calculate:event of the nummeric field.
  1. var nValue = Sum(NumField1,NumField2,NumField2)
  2.  
  3. if(nValue >= 100) then
  4. this.caption.font.weight = "bold"
  5. else
  6. this.caption.font.weight = "normal"
  7. endif
  8. $ = nValue

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

In FormCalc, refer to radzmar's script.

Here's what I used to confirm yesterday which is in javascript, and this works fine in Dynamic forms.

if (this.rawValue >= 100){this.caption.font.weight = "bold";this.font.weight = "bold";}else{this.caption.font.weight = "normal";this.font.weight = "normal";}
abrob
Registered: Aug 15 2010
Posts: 8
Thanks guys for your cooperation....... but unfortunately this is not working for my field located in a table cell.

Abrob