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

var a  = this.getField("oneA")
var b = this.getField("oneB")

if (a.value == ""){
b.value = "Please enter a response"
} else if (a.value != "mary" || "Mary"){
b.value = "Incorrect"
} else {
b.value = "Correct"
}

if I take out the pipes "||" on the first "else if" statement this works (a.value != "mary") but as above does not.

I thought the "||" was "or"?

Am I missing something?

thx


Dave



On 29-Apr-04, at 3:31 PM, Max Wyss wrote:


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 ]


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



Reply via email to