Skip to main content
stepheng54012748
Known Participant
October 25, 2024
Answered

javascript help

  • October 25, 2024
  • 1 reply
  • 679 views

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

 

This topic has been closed for replies.
Correct answer PDF Automation Station

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;

1 reply

PDF Automation Station
Community Expert
Community Expert
October 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;

stepheng54012748
Known Participant
October 25, 2024

Awesome!!!  That worked like a charm.

 

THANK YOU!!