Here is what I am using. This appears to work in other configurations for other form fields...but for this and two others they just don't want to calculate. No error messages, just nothing invoked.
if(this.getField("noweeks").value >= 104)
{
event.value = 185
}
else
{
event.value = 0
}
The current field is a number format.
The noweeks field is also a number format.
I would ideally like the else value to be "" and not 0...but I will take what I can get.
Just, why will this not calculate?
There's nothing obviously wrong. You checked the console window for errors?
If I've got it right so far then the next step is to add a console.println statement to the code to check that the calculation script is in fact executed, and that the value of "noweeks" is being acquired correctly.
like this:
var nNoWks = this.getField("noweeks").value;
console.println("No Weeks Value = " + nNoWks);
if(nNoWks >= 104)
{
... and the rest ...
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script