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

Javascript Event Values

Participant ,
Oct 28, 2024 Oct 28, 2024

Hello community,

 

I'm hoping someone might be able to help me with a script I'm trying to write.  I have (3) fields of text information (First, M, Last) and when someone fills in each section on the form my goal is to populate those inputs into one field somewhere else on the form.

Field 2a = First

Field 3a = M

Field 4a = Last

 

I know that "event.value=this.getField("2a").value" will give me the value that is in Field 2a.  I just don't know how to put them together into one field and so there is a space in between.  

 

Any help or suggestions would be much appreciated!

 

Thank you in advance.

TOPICS
How to , JavaScript , Modern Acrobat , PDF forms
861
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 ,
Oct 28, 2024 Oct 28, 2024

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

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

AWESOME!!!  THANK YOU so much.  Exactly what i needed.  

 

Appreciate it.

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

Be aware that using that code if the second field is empty you'll get two spaces in the middle of the combined name...

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 ,
Oct 28, 2024 Oct 28, 2024
LATEST

Got it.  I appreciate the headsup

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