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

copy function

Participant ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

Hi
Please, can anyone help me solve this question?
I created this js acrobat function

var s1=this.getField("RESIDENT IN").value;
var s2=this.getField("RESIDENT IN_2").value;
var a1=this.getField("VIA").value;
var a2=this.getField("VIA_2").value
var b1=this.getField("N").value;
var b2=this.getField("N_2").value;
var residence1=s1+a1+b1;
var residence2=s2+a2+b2;
if(residence2==residence1)event.value=this.getField("4").value;

I inserted this function in the calculation script of field 4_2

I would like that when field 4 is empty, you can freely write any text in field 4_2

TOPICS
JavaScript

Views

358

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 24, 2024 Feb 24, 2024

Hi,

Try this condition instead of yours:

if (event.source && event.source.name=="4" && residence2==residence1 && this.getField("4").value!="") event.value=this.getField("4").value;

 @+

Votes

Translate

Translate
Community Expert ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

Hi,

Try this condition instead of yours:

if (event.source && event.source.name=="4" && residence2==residence1 && this.getField("4").value!="") event.value=this.getField("4").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
Participant ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

once I have inserted the formula suggested to you, I can write the text in field 4_2, but when I write a text in field 4, the latter is not copied into field 4_2

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

... and residence2==residence1 in your example???

That's working find for me!

@+

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
Participant ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

LATEST

sorry
works!!
I had made a mistakesorry
works!!
I had made a mistake

Thank you very much

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