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


On Apr 29, 2004, at 3:11 PM, david lindblad wrote:


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

Dave,

1.) The expression "many" || "Many" should always evaluate to 1, or TRUE.
2.) In the first tested condition, you used: if(a.value == "") to test for the null string. In the second, you used != to test for string inequality.
Try entering "1" in the field affected by the JS and see whether b.value comes up "Incorrect". You may want to re-form your logical test like this: if ((a.value !== "many") || (a.value !== "Many)){ ...


Jim Plante
<[EMAIL PROTECTED]>



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



Reply via email to