These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need help with a form field calculation script

shash7
Registered: Sep 23 2009
Posts: 3
Answered

I'm on Acrobat 8 Pro, and I'm having trouble getting a calculation script to work. All I need it to do is multiply a field by $75.00 (the $75 won't change), but I can't quite get the syntax right. I'm technical but not an expert, and would appreciate any help y'all can give. Thanks!

My Product Information:
Acrobat Pro 8.0, Windows
smitchell15 (not verified)
Hi
Use simplified field notation in the field that contains the answer and type name of field * 75
for example Field1 * 75 that should work

Hope that helps
shash7
Registered: Sep 23 2009
Posts: 3
Thank you for your response! Is there anything else--quotes, colons, etc.?

Based on your response, I typed the field name, *, 75, so:

Total Hourly Services lines 1-8*75

It didn't work. I tinkered a bit and managed to get it to calculate, but it just reflected what was in the "total hourly services field", rather than multiplying that field by $75.

Thanks again!

P.S. I should add that, no matter what I try, the Javascript Debugger launches. Thanks.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You need to use 'simplified' field names and that means no spaces or special characters.

If you were to create a hidden field with a value of '75' you could use the 'the product of' and select the fields. Otherwise you will need to write a 'custom calculation script'.

event.value = this.getField('Total Hourly Services lines 1-8").value * 75;

George Kaiser

d2mrp0
Registered: Oct 14 2009
Posts: 1
Hi everyone, I am new to this group. Have some programming skills in VB years ago so not completely clueless but in need of help with Adobe forms in Adobe Acrobat 8.1.3 / Windows XP /SQL 2005.


I have a form that is populated from a database (uses the Adobe Text Field name property to specify the table and field ie: Rx.Date). All my text fields populate fine.

My problem is this: I would like to add days to the returned date value from one of the fields, (mm/dd/yyyy) and present this in a new text field.

I am struggling with the javascript to grab this returned value, assign it to a variable, then add 7 days to the date and finally present the new date value in a text field.

Hope that makes sense. I am basically trying to add days to a returned date value that comes from a database - not from a user input. I've trolled the net and seen lots of examples manipulating user input but not the value from a database field. I think* there is a big difference.

Any help is greatly appreciated. I have some basic javasrcipt going on to assign the returned database date value to a variable...that's where I got bogged down.

Thanks

d2mrp0
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
This new post is beyond the scope of the original post and should have been a new post.

You will need to write 'custom calculations' as the 'simplified field calculations' can not use the '.' in the file name and can not use the date object and methods.

Thom Parker has posted some tutorials on date and time calculations that you should look at.

George Kaiser