ok, i have been searching the web and cannot find what I need, partly because I am not too familiar with javascript.
I have created an adobe form, and there are 6 fields I am working with. field1 is a user input (sales price) that gets calculated with EITHER a commission value for percentage (field2) OR a flat fee (field3) (field2 and field3 are also user input, and either one or the other will be filled with a user input value, but not both, so one would be blank). however there are 2 more fields that needs to be subtracted as well (field4 and field5) to calculate the value of field 6. I know an if-else statement would work by I'm sure I'm not putting it together properly. My question is: How can I write the correct code to get the value of Field6 IF field2 is blank OR field3 is blank. I have tried every way till sunday to figure this out on my own. This is the latest code I tried, I've replaced the actual field names to correspond to field1, field2......
event.value = "";
var sp = this.getField(“field1”).value;
var cp = this.getField(“field2”).value;
var ffc = this.getField(“field3”).value;
if (cp!=“null” || cp!=""){
event.value = (sp * cp * .01) - field4 - field5
} else if (ffc!="null" || ffc!="" ){
event.value = ffc - field4 - field5
}
The adobe form does not give me any syntax errors, but it just won't calculate
Aucun commentaire:
Enregistrer un commentaire