Help getting field validation to ignore N/A
Hi all i'm very new to javascript and adobe forms.
I have a form in which if a data entry field is not used it is automatically populated with N/A. The N/A in the field is determinned by a calculation in a seperate field we'll call Field1. Depending on the value of Field1 the data entry field is either N/A and read only or the field is blank and the user needs to enter a value. When a value is entered i have the field validating the entry against a range, if its outside the range an app.alert notifies the users.
I'm having trouble getting the validation to ignore the N/A. it sees it as an entry outside the range and the alert box appears.
In the calculation box of Field1 i have
if (event.value>=3.335){
this.getField("Powder").value="N/A";
this.getField("Powder").readonly=true;
}
else{
this.getField("Powder").value="";
this.getField("Powder").readonly=false;
}
In the validation of the Powder field i have:
if (event.value>Upper || event.value<Lower && event.value!="" && event.value!="N/A"){
app.alert("Powder weight must be between "+Upper+"g and "+Lower+"g weight limit.",1);
event.target.textColor=color.red;
event.setFocus();
}
else{
event.target.textColor=color.black;
}
