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

javascript help

Participant ,
Oct 25, 2024 Oct 25, 2024

Copy link to clipboard

Copied

Hello my friends,

 

I'm hoping someone can help me with a javascript i'm trying to write on a form i'm creating.  The field "4a" is someone's last name they will input.  Once they put there last name in this field i want it to populate exactly as they type it to another field "a14a11".  I don't know the correct terminology in my coding to make this happen.  Below is what i've come up with and it does not work.  Any assistance would be greatly appreciated.

 

var theField = this.getField("4a");
var theValue = theField.value;

if (+theValue > .01) {
this.getField("a14a11").value= (+theValue);
}
else {
this.getField("a14a11").value=(+theValue);
}

 

TOPICS
JavaScript , Modern Acrobat , PDF forms

Views

199

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 , Oct 25, 2024 Oct 25, 2024

The easiest way is to copy the 4a field.  Fields with the same name can only have one value.  As soon as a value is entered into either of the 4a fields it will automatically copy to the other field.  If you don't want to do this for whatever reason, simply enter the following custom calculation script the a14a11 field:

event.value=this.getField("4a").value;

Votes

Translate

Translate
Community Expert ,
Oct 25, 2024 Oct 25, 2024

Copy link to clipboard

Copied

The easiest way is to copy the 4a field.  Fields with the same name can only have one value.  As soon as a value is entered into either of the 4a fields it will automatically copy to the other field.  If you don't want to do this for whatever reason, simply enter the following custom calculation script the a14a11 field:

event.value=this.getField("4a").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 ,
Oct 25, 2024 Oct 25, 2024

Copy link to clipboard

Copied

LATEST

Awesome!!!  That worked like a charm.

 

THANK YOU!!

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