Answered
Hi, I'm fairly new to writing javascript in acrobat. I'm having an issue with the code below.
This is what I'm trying to say...
IF F3 greater then 800001 take 250000-F4
IF F3 greater then or equal to 250000 the the value equals 250000
IF F3 less then 250000 then the value should be F3
Does any one have a good example?
Here is my code...
var F3 = this.getField("F3").value; var F4 = this.getField("F4").value; if ( F3 > 800000) { event.value = 250000 – F4; } else if ( F3 >= 250000) { event.value = 250000; } else { event.value = F3; }
I keep getting an error saying Illegal character 5: at line 6
Does anyone know what I am doing wrong? I would appreciate any help! Thanks!
This tutorial from the Learning Center here discusses writing conditional statements for PDF forms-
http://www.acrobatusers.com/tutorials/conditional-execution
The minus sign used in Line 5 is causing an error- these type errors can be seen if you use something like a Word Processor for writing code then copy from it- illegal characters, extra carraige returns and wrong quote types are common problems. You should always use a plain text editor like Notepad, etc.
Hope this helps,
Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
Dimitri Munkirs
WindJack Solutions
pdfscripting.com