Skip to main content
Participant
July 23, 2020
Answered

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

  • July 23, 2020
  • 1 reply
  • 2563 views

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!

This topic has been closed for replies.
Correct answer try67

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;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 23, 2020

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;

Participant
July 30, 2020

That worked perfectly! Thanks heaps!