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

Need help with my script for a condition when 2 fields match

New Here ,
Feb 06, 2020 Feb 06, 2020

Copy link to clipboard

Copied

Hi all,

I am designing a form in Adobe Pro DC in which I have 4 text fields (Numfield1, Numfield2, Namefield1 and Namefield2) if these fields match or if the difference is 0 (Numfield1 minus Numfield2), I want Namefield2 to autofill the value of Namefield1.

I have been trying with the below code, please note i'm not a programmer and my skillset is limited to finding scripts and customising it for my purpose, hence this script might be way off the mark.

 

var A = this.getField("Numfield1").value; // the value of field A;

var B = this.getField("Numfield2").value; // the value of field B;

var C = A - B; // the value of field A minus the value of field B;

if (C = 0) {

event.value = this.getField("Namefield1").value;

}

TOPICS
PDF forms

Views

560

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

correct answers 1 Correct answer

Community Expert , Feb 07, 2020 Feb 07, 2020

Use:

if (C == 0) {

Votes

Translate

Translate
Community Expert ,
Feb 07, 2020 Feb 07, 2020

Copy link to clipboard

Copied

Use:

if (C == 0) {

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
New Here ,
Feb 07, 2020 Feb 07, 2020

Copy link to clipboard

Copied

LATEST

Thank a million, it works just as i wanted

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