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

copy function

Participant ,
Feb 24, 2024 Feb 24, 2024

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
616
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 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;

 @+

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

 @+

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

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

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

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

That's working find for me!

@+

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

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

Thank you very much

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