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

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

Guest
Feb 06, 2020 Feb 06, 2020

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
1.1K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Feb 07, 2020 Feb 07, 2020

Use:

if (C == 0) {

View solution in original post

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

Use:

if (C == 0) {

Translate
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
Guest
Feb 07, 2020 Feb 07, 2020
LATEST

Thank a million, it works just as i wanted

Translate
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