Copy link to clipboard
Copied
Hello all, what I need with is a javascript button that will enable me to click it and the result will remove the amount from the calculation, click it again and the amount that was removed will be added again.
Let me explain what I'm trying to do. I am creating a form that shows the total of material costs, then adds a percentage markup to the material costs from a drop down. Then I have a field to select the labor for the job. I'd like to have a button to remove the labor to see only the material costs by itself. Then click the button again and the labor total would be added once again without having to re-type it in. Would someone have a javascript that would help me do what I want? I hope it can be done. Thanks.
Copy link to clipboard
Copied
I would use a check-box, and a custom calculation script to add the value to the total when it is ticked, or not add it when it isn't.
Copy link to clipboard
Copied
but how would I do that? I don't know the scripting to add to the custom calculation. And then how would I redo and then show the amounts that I turned off to get the grand total again? It would be a great help if you could help me with the script? Thanks.
Copy link to clipboard
Copied
How are you currently calculating the total?
Copy link to clipboard
Copied
well, summing the materials is pretty basic, I'm using hierarchical method. All the totaling fields are name like this Total.1, Total.2 etc. and in the calculation window I just have Total. It works fine. The labor fields are basically adding the labor fields the same way. I have a field that totals all the material fields and a field that totals all the labor fields then totals both materials and labor fields. I also have a field (drop down) that allows me to select a mark up on both fields. Not too confusing, huh?
What I'm doing presently, is simply deleting the labor fields (drop down fields) when I want to see only the material costs. But, it's a hassle and unprofessional to have to then reselect the labor fields. What if I make a mistake when I re-enter that info? That's a big opps. So, I thought to have a button that would allow me to have the labor info then to re-enter the labor info without making a mistake. Know what I mean?
Copy link to clipboard
Copied
Not quite, but if you want to add a value conditionally to a total it's quite easily done. I just posted a code that does just that, here: Re: Value from an Amount field added to "Yes" Check Boxes to come up with total
Copy link to clipboard
Copied
I looked at the link you provided. I tried it out, but it's not what I was hoping for. What I was hoping to do is basically the same thing as Edit >Undo/Redo. I'm working in the FullScreen mode most of the time and I really don't want to exit the FullScreen mode to make the selection. So, I thought there would be a javascript that I could attach to a button that would do the same thing without having to exit the FullScreen mode. Is that possible?
Copy link to clipboard
Copied
You don't need exit the FullScreen mode.