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

Fill in text form depending on a value of another form

Community Beginner ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

I have a text field "Employeenumber" with format set to number, which can take values of 1-20.

I also have a few text fields to fill in for each employee.

I would like to create a button that fills in the forms for employees 2-20 by copying the information already filled in for employee 1. The thing is, I would like to be able to control to how many employees the information flows, depending on the number which has already been introduced at "Employeenumber".

 

So, I have made a button in which I planned to use the java script below at mouse down, but I think I missed something in the code, as it doesn't work (i added the code for value "2" only, but I plan to create similar if clause for the numbers 3-20).

 

if(this.getField("EmployeeNumber") == '2')

{

this.getField("Employee2data").value = this.getField("Employee1data ").value;

}

 

Can someone help?

 

Thank you so much!

 

 

Views

340

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 09, 2020 Oct 09, 2020

You must use the value of the field. E.g.:

if(this.getField("EmployeeNumber").valueAsString == '2')

Votes

Translate

Translate
Community Expert ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

I'm assuming you're working in Acrobat, so I'm going to move this to the Acrobat forum. If I'm wrong, say which program you're working with and someone will move the post to the appropriate forum.

 

The Using the Community forum is for help in using the Adobe Support Community forums, not for help with specific programs. Product questions should be posted in the associated product community.

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 Beginner ,
Oct 12, 2020 Oct 12, 2020

Copy link to clipboard

Copied

Thank you! I'm working with Acrobat, indeed.

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 ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

You must use the value of the field. E.g.:

if(this.getField("EmployeeNumber").valueAsString == '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 Beginner ,
Oct 12, 2020 Oct 12, 2020

Copy link to clipboard

Copied

LATEST

This worked! Thank you so much for your help!

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