Compare date and insert % calculation of value depending on result
I have managed to muddle my way through to a degree but I am now at a point where I require to add a script to an Adobe Form.
I wish to introduce a SURCHARGE of 10% to a SUBTOTAL value if the ordering DATE deadline has passed (as this will incur additional charges by us).
The SUBTOTAL and DATE fields exist, the new field is SURCHARGE where the script will reside.
I have the current system date inserted automatically on the form using:
var f = this.getField("DATE");
f.value = util.printd("dd/mmm/yyyy", new Date());
In Excel its relatively easy using the (if : else) commands, but java is just beyond me. I would be grateful if one of you learníed ones could spare me some of your knowledge.
CAPS - field names
Thanks in advance