Increment button for calculated field
I'm pretty much a novice, but able to get some decent engineering calculation worksheets built.
I have a series of dependent calculations that after some user input calculate the depth of a modular water storage tank. The final depth result field has a calculation script and it set to read-only. I want to add plus/minus increment buttons to allow users to see what the water volume capacity will be if they decrease the depth by the one module (the value is 0.33).
I tried various scripts from forums, but none work. None give an error - they just don't work. I have a feeling because the rest of the calculations on the sheet are dynamic (i.e. if the user changes an input value, everything recalculates), I am not using the correct script. I did try "clearing" any value from the field in question...
Here is the scrip that I have in the button action javascript field (on mouse up):
var x = this.getField("RSD"); // this is the field that is initially calculated that I want to allow users to incrementally change
var y = (x -= 0.33); // decrease field RSD value by 0.33 on mouse up
if(x.value!=”||x.value!=null){x.value=”} // clear value in RSD
if(x.value==”||x.value==null){x.value=y.value} // assign y value to RSD
Or is it that I am missing a command to "write" to field RSD?
Any help/direction will be appreciated.
Thanks!
