Highlighted

APPEAR

New Here ,
Jul 17, 2020

Copy link to clipboard

Copied

hello.

I have 4 fields Α2,Β2,Α3,Β3 

In B3 field i use this code

// Get field values as numbers

var v1 = +getField("B2").value;

var v2 = +getField("A3").value;

// calculate this field value

event.value = v1- v2;
event.value = Math.ceil(event.value);

It works but i would like to appear in B3 when i write a number in A3.If no i do not want to be appeared

Topics

PDF forms

Views

22

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

APPEAR

New Here ,
Jul 17, 2020

Copy link to clipboard

Copied

hello.

I have 4 fields Α2,Β2,Α3,Β3 

In B3 field i use this code

// Get field values as numbers

var v1 = +getField("B2").value;

var v2 = +getField("A3").value;

// calculate this field value

event.value = v1- v2;
event.value = Math.ceil(event.value);

It works but i would like to appear in B3 when i write a number in A3.If no i do not want to be appeared

Topics

PDF forms

Views

23

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
try67 LATEST
Most Valuable Participant ,
Jul 17, 2020

Copy link to clipboard

Copied

Use this code:

 

var s1 = this.getField("B2").valueAsString;
var s2 = this.getField("A3").valueAsString;
if (s1 && s2) {
	var v1 = Number(s1);
	var v2 = Number(s2);
	event.value = Math.ceil(v1 - v2);
} else event.value = "";

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Resources
One Stop Solution for Acrobat
Edit a PDF