• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

APPEAR

Community Beginner ,
Jul 17, 2020 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

184

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
community guidelines
Community Expert ,
Jul 17, 2020 Jul 17, 2020

Copy link to clipboard

Copied

LATEST

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 = "";

Votes

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
community guidelines