Highlighted

Fill in text form depending on a value of another form

Community Beginner ,
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!

 

 

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

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

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

Views

42

Likes

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

Fill in text form depending on a value of another form

Community Beginner ,
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!

 

 

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

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

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

Views

43

Likes

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
Oct 09, 2020 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Oct 09, 2020 0
Community Beginner ,
Oct 12, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Oct 12, 2020 0
Adobe Community Professional ,
Oct 09, 2020

Copy link to clipboard

Copied

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

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

Likes

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
Reply
Loading...
Oct 09, 2020 0
Community Beginner ,
Oct 12, 2020

Copy link to clipboard

Copied

This worked! Thank you so much for your help!

Likes

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
Reply
Loading...
Oct 12, 2020 0