Answered
If anyone can help point me in the right direction I'd be very grateful.
I'm currently using Acrobat Pro v8.0 (Mac)
I have three fields: "Name1", "Name2" and "CharCnt"
I would ideally like the field "CharCnt" to add the two other field lengths together to give a total character count while typing text in either "Name1" or "Name2". A live count if you will.
I have "CharCnt" doing the job already but it only calculates the total when I exit or move to the next field. I've tried mucking around with various custom keystroke scripts (through much digging of this forum) but they either don't work at all (probably because of my feeble attempts) or I'm back where I started.
Any help gratefully received :0)
http://www.acrobatusers.com/tutorials/2006/formatting_text_fields
It is important that the script is qualified with event.willCommit. Also, the full entry string is not provided, but there is enough information in the event object to build it.
The next bit, adding two counts together, is even trickier. It is an extremely bad idea to use a calculation event in this case. In fact, all calcuations should be turned off while the user is entering data so that the form doesn't go out to lunch. This particular keystroke scirpt will be entering data into a field (the count field), which will prompt acrobat to fire calculation event.
Here's the technique, since the user can only enter data into one field at a time, the keystroke script should acquire the other text field, do the addition and put the result into the count field. The count field is then set from whichever text field the user is currently using.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script