PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________

I just checked the following code in Acrobat 6 (easier to debug <g>), and this one definitely works:

    var a = this.getField("a") ;
    var b = this.getField("b") ;

    if (b.value * 1 != 0) {
    event.value = a.value / b.value ;
    }

This above code is assigned to the Calculate event of the result field.

Note that you might add semicolons at the end of the statements (they are not mandatory, but sometimes you may encounter weird behavior).

Hope, this can help


Max Wyss PRODOK Engineering Low Paper workflows, Smart documents, PDF forms CH-8906 Bonstetten, Switzerland

Fax:  +41 1 700 20 37
  or  +1 815 425 6566
e-mail:  mailto:[EMAIL PROTECTED]
http://www.prodok.com



[ Building Bridges for Information ]


______________________



Shameless Plug:

My next conference appearances and workshops:
• Conference presentations at the 2004 Symposium of the BFMA, May 23 to 27 in Reno, Nevada (http://www.bfma.org) and pre-/post-conference workshop, May 22/23 and 27, organized by essociates Group (http://www.essociatesgroup.com/AdvancedAcrobatForms.htm)
• And, as always, available for on-site workshops/tutorials/consulting.



_________________________



Thanks Max.  I tried this correction and it still does not work? It
thinks there is a syntax error in the calc on line 3.  Can you check it
out?

var a = this.getField("a")
var b = this.getField("b")
if (b.value * 1) != 0)
{event.value = a.value / b.value}




To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html



Reply via email to