Skip to main content
Natalie_Ping
Inspiring
July 16, 2020
解決済み

Custom script to show a field if values are equal to or greater than 1

  • July 16, 2020
  • 返信数 1.
  • 652 ビュー

I'm new to editable PDF's and a novice at Javascript. I have three number fields (Text11, Text19, Text27) that if the value inside any one of them is one or higher - I need it to unlock another box below (OTHER1). Does anyone know how I programme this with custom script? 

 

Thanks!

このトピックへの返信は締め切られました。
解決に役立った回答 try67

You can do it using this code as the custom calculation script of the text field:

 

var v1 = Number(this.getField("Text11").valueAsString);
var v2 = Number(this.getField("Text19").valueAsString);
var v3 = Number(this.getField("Text27").valueAsString);
event.target.readonly = (v1>=1 || v2>=1 || v3>=1);

返信数 1

try67
Community Expert
try67Community Expert解決!
Community Expert
July 16, 2020

You can do it using this code as the custom calculation script of the text field:

 

var v1 = Number(this.getField("Text11").valueAsString);
var v2 = Number(this.getField("Text19").valueAsString);
var v3 = Number(this.getField("Text27").valueAsString);
event.target.readonly = (v1>=1 || v2>=1 || v3>=1);

Natalie_Ping
Natalie_Ping作成者
Inspiring
July 16, 2020

Thank you! That has worked!