Highlighted

Can I have a text field have a custom calculation AND still allow a user to enter custom content?

New Here ,
Jul 22, 2020

Copy link to clipboard

Copied

Hi! 

 

I've made a quotation form using Adobe acrobat form editor. 

I've set it up with four columns - product, quantity, cost per unit, and total cost. 

I've set up the fields so our sales team can select the product from a drop-down (options items) which automatically inserts the cost per unit that I inserted in the export value of the drop-down items.

 

This works really well - however, sometimes the cost per unit might need to be changed manually and I can't seem to figure out how to set the field to allow the user to enter custom text when needed. 

 

The script I'm using is:

event.value = this.getField('ProductRow1').value; 

I'm assuming I'll need to add something to this - but I'm no pro at Javascript and I'm not sure what! 

 

Thanks in advance!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes, it's possible, but it can get quite complicated, especially if the calculation depends on multiple fields, and they also have a calculated value. If it doesn't then you can use this:

 

if (event.source && event.source.name=="ProductRow1")

event.value = this.getField('ProductRow1').value;

TOPICS
PDF forms

Views

34

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

Can I have a text field have a custom calculation AND still allow a user to enter custom content?

New Here ,
Jul 22, 2020

Copy link to clipboard

Copied

Hi! 

 

I've made a quotation form using Adobe acrobat form editor. 

I've set it up with four columns - product, quantity, cost per unit, and total cost. 

I've set up the fields so our sales team can select the product from a drop-down (options items) which automatically inserts the cost per unit that I inserted in the export value of the drop-down items.

 

This works really well - however, sometimes the cost per unit might need to be changed manually and I can't seem to figure out how to set the field to allow the user to enter custom text when needed. 

 

The script I'm using is:

event.value = this.getField('ProductRow1').value; 

I'm assuming I'll need to add something to this - but I'm no pro at Javascript and I'm not sure what! 

 

Thanks in advance!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes, it's possible, but it can get quite complicated, especially if the calculation depends on multiple fields, and they also have a calculated value. If it doesn't then you can use this:

 

if (event.source && event.source.name=="ProductRow1")

event.value = this.getField('ProductRow1').value;

TOPICS
PDF forms

Views

35

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
Jul 22, 2020 0
Most Valuable Participant ,
Jul 23, 2020

Copy link to clipboard

Copied

Yes, it's possible, but it can get quite complicated, especially if the calculation depends on multiple fields, and they also have a calculated value. If it doesn't then you can use this:

 

if (event.source && event.source.name=="ProductRow1")

event.value = this.getField('ProductRow1').value;

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...
Jul 23, 2020 1
New Here ,
Jul 29, 2020

Copy link to clipboard

Copied

That worked perfectly! Thanks heaps! 

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...
Jul 29, 2020 0