Skip to main content
Participant
April 18, 2017
Question

Conditional script is not working in PDF form.

  • April 18, 2017
  • 1 reply
  • 490 views

Hi All,

Appreciate for the expertise. I have a pdf form to capture values from external DB upon printing from our in-house application. I would like to implement a GST_txt field to display "SR", "ZR" according to the GST column value.

I have added below scripts under calculation scripts of "GST_Txt2" form, however it doesn't display correctly even though "txtOther2Tax" >0.00. Hope someone can advise me further on this, Million thanks in advance!!

var v1 = this.getField("txtOther2Tax").value;

if (v1 > 0.00) {

    event.value = "SR";

} else {

    event.value = "ZR";

}

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 18, 2017

Try changing the first line to:

var v1 = Number(this.getField("txtOther2Tax").value);

If that doesn't work check the JS Console for any error messages.

Participant
April 19, 2017

Hi try67,

it's not working either. More information, the text fields are flatten from code upon printing, something to do with Printing Servlet?

try67
Community Expert
Community Expert
April 19, 2017

If the fields are flattened then they are not dynamic anymore and you can't change their values...