order form sum total - can I shorten this code?
I know there are document-level advanced formulas, but that's way beyond my level. I have an order form that is working well, thanks to Adobe community help
. Quantity x Price = Product Total. I am at the total dollar for all products field, and once again want the field blank rather than $0.00 to start. So I'm not using the basic 'select all the fields option'.
I'm about to put the following code in which, with 49 fields, will be quite lengthy. I am also applying the Number AsString coding offered for a previous issue, but don't know if that is the right use here. (I presume it is since I am adding numbers.) Is there a shorter way (without going to the document level coding), or do I just keep adding fields?
I did try it with 49 qty but the total was shifting the decimal place: $10.50 + $8.50 were added as $105.00 and $85.00. When I took it back down to test as just qty1 + qty2, it is working ok.
Thanks for any insights and assistance.
var qty1 = Number(this.getField("tikmb").valueAsString);
var qty2 = Number(this.getField("tdtb1").valueAsString);
if( (qty1 + qty2 ) >0) event.value = qty1 + qty2;
else event.value = "";
