Is there a way to modify this script to be reuseable in a function?
Hello,
I have this script inside a load of buttons (Currently 16 individual buttons)
They all have a different value and some of them increment positively and some negatively they are + - buttons
Here is the the Script:
var fldTI1 = this.getField("20mmLeft");
if (isNaN(fldTI1.value)) {
fldTI1.value = 0;
}
else {
fldTI1.value += 1;
this.getField("LeftAddOnTotal").value += 20;
}
I'm wondering if I can make this more universal so that I only have to write it in a function and call that function?
I know I will most likely have to write 2 functions for each value (15, 20, 35 and 50), one for the positive increment and one for the negative increment.
I was thinking something along the lines of using var fldT1 = this.getField(event.target.name); or something like that so that the var pulls the name from where the function was called?
I've tried looking into event.target syntax and what it does but I can't find a clear explanation as to what it actually does.
Any help and suggestions would be greatly appreciated.
Thank you in advance!
